刷新网页时显示模态弹出面板
在我的网页中,我使用 ModalPopupExtender
弹出模式弹出窗口以添加条目。 PopupControlID
是一个面板
,它以相同的形式驻留在其中。问题是刷新网页时,PopupControlID
面板会短暂显示并消失。单击面板上的“确定”按钮时也会发生同样的问题。请参阅下面的标记,请指导我解决问题,
<ATK:ModalPopupExtender
BackgroundCssClass="ModalPopupBG"
DropShadow="true"
CancelControlID="btnCancel"
runat="server"
PopupControlID="AddTopic"
id="ModalPopupExtender1"
TargetControlID="btnAddNew"/>
<asp:Panel ID="AddTopic" runat="server" CssClass="popup_Container" Style="display: none;" >
<div class="popup_Titlebar" id="PopupHeader">
<div class="TitlebarLeft">
Add New Topic
</div>
<div class="TitlebarRight" onclick="cancel();">
</div>
</div>
<div class="popup_Body">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTopic" runat="server" Text="Topic Name"> </asp:Label>
<asp:TextBox ID="tbTopicName" runat="server" Width="400px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="*" ControlToValidate="tbTopicName" >
</asp:RequiredFieldValidator>
</ContentTemplate>
</asp:UpdatePanel>
<br /> <br />
<span style="padding-left:350px">
<asp:Button ID="btnDone" runat="server" Text="Ok" onclick="btnDone_Click" />
<input id="btnCancel" value="Cancel" type="button" OnClick="cancel();" />
</span>
</div>
</asp:Panel>
In my web page I'm using a ModalPopupExtender
to popup a modal popup windows to add an entry. The PopupControlID
is a panel
, which is resides in the same form. The issue is the while refreshing the webpage the PopupControlID
panel showing for a short time and disappearing. The same issue happens while click on the OK
button on the panel. Please see the Markup below, Please guide me to resolve the issue,
<ATK:ModalPopupExtender
BackgroundCssClass="ModalPopupBG"
DropShadow="true"
CancelControlID="btnCancel"
runat="server"
PopupControlID="AddTopic"
id="ModalPopupExtender1"
TargetControlID="btnAddNew"/>
<asp:Panel ID="AddTopic" runat="server" CssClass="popup_Container" Style="display: none;" >
<div class="popup_Titlebar" id="PopupHeader">
<div class="TitlebarLeft">
Add New Topic
</div>
<div class="TitlebarRight" onclick="cancel();">
</div>
</div>
<div class="popup_Body">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTopic" runat="server" Text="Topic Name"> </asp:Label>
<asp:TextBox ID="tbTopicName" runat="server" Width="400px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="*" ControlToValidate="tbTopicName" >
</asp:RequiredFieldValidator>
</ContentTemplate>
</asp:UpdatePanel>
<br /> <br />
<span style="padding-left:350px">
<asp:Button ID="btnDone" runat="server" Text="Ok" onclick="btnDone_Click" />
<input id="btnCancel" value="Cancel" type="button" OnClick="cancel();" />
</span>
</div>
</asp:Panel>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是正常行为。如果您想在单击按钮后显示弹出窗口,则必须在按钮单击结束时设置
ModalPopupExtender1.Show()
。但是刷新时模式弹出窗口将会消失。i think it is the normal behaviour. If you want to show the popup after button click you have to set
ModalPopupExtender1.Show()
at the end of button click. But while refreshing modal popup will disappear.