具有ListView的ModalPopupExtender显示记录,单击更新后,弹出窗口关闭 [英] ModalPopupExtender with ListView showing records, upon clicking the update the popup closes

查看:69
本文介绍了具有ListView的ModalPopupExtender显示记录,单击更新后,弹出窗口关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ModalPopupExtender,里面有一个列表视图.我遇到的问题是,如果单击更新"按钮(显示Listview时,页面将刷新并隐藏弹出窗口.如何强制弹出窗口保持打开状态,直到单击关闭按钮?

I have a ModalPopupExtender that I have a listview inside of. The problem I am having is if you click on the Update button (when the Listview is show, the page refreshes and hides the popup. How can I force the popup to stay open until the close button is clicked?

<asp:ScriptManager ID="asm" runat="server" />
 <asp:Panel ID="ModalPanel" runat="server" Width="90%" Height="90%" BackColor="Ivory"  >



~~~~~ Listview对象~~~~



~~~~~Listview object~~~~

    <br />
    <asp:Button ID="OKButton" runat="server" Text="Close" />

<asp:ModalPopupExtender ID="mpe" runat="server" TargetControlId="btnOSHA" PopupControlID="ModalPanel" OkControlID="OKButton" />

推荐答案

添加HiddenField控件,并将其用作ModalPopupExtender (mpe)中的TargetControlID,如下所示.
Add a HiddenField control and use it as your TargetControlID of your ModalPopupExtender (mpe) as shown below.
<asp:modalpopupextender id="mpe" runat="server" targetcontrolid="HiddenField1" popupcontrolid="ModalPanel" okcontrolid="OKButton" xmlns:asp="#unknown" />



然后,您需要使用:
,而不是通过TargetControlID自动显示弹出窗口.



Then, instead of automatically showing the Popup thru TargetControlID, you need to use:

mpe.Show();



和关闭:



and for closing:

mpe.Hide();



问候,
爱德华



Regards,
Eduard


这篇关于具有ListView的ModalPopupExtender显示记录,单击更新后,弹出窗口关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆