【发布时间】:2009-10-22 18:59:08
【问题描述】:
我正在尝试让模式弹出窗口工作,它需要在后面的代码中触发。
<asp:Button ID="btnModalPopUp" runat="server" Text="Button" Style="display: none" />
<asp:Panel ID="pnlModalPopup" runat="server" CssClass="modalPopup" Style="display: none"
Width="233px">
<div id="Div1" runat="server" cssclass="title">
Modal text here.
<asp:TextBox ID="txtEditComments" runat="server"></asp:TextBox>
</div>
</asp:Panel>
<cc1:ModalPopupExtender ID="modalMessage" runat="server" TargetControlID="btnModalPopUp"
PopupControlID="pnlModalPopup" BackgroundCssClass="modalBackground" DropShadow="true"/>
后面的代码:
protected void Page_Load(object sender, EventArgs e)
{
modalMessage.Show();
}
即使它命中了“modalMessage.Show();”代码它不显示模态面板。
【问题讨论】:
-
好的 - 有什么问题?顺便说一句:
-
@Arthur:
display:none是装饰性的,否则在页面加载时弹出窗口会显示,然后在ModalPopupExtender启动并隐藏它时会迅速消失。 -
只是一个问题,但是如果您从 btnModalPopup 中删除“display:none”,这是否有效?
标签: c# asp.net modalpopupextender