I have a page which loads children pages by using jQuery's .load function...
我有一个页面,通过使用jQuery的.load函数加载子页面...
My children pages have buttons to perform some data exchange with the database server and most of them are doing ok.
我的子页面有按钮与数据库服务器进行一些数据交换,其中大多数都正常。
the problem is that some buttons are inside ModalPopupExtenders (ajaxtoolkit). When I run the children page alone (outside the parent) the modalpopup and it's buttons works perfectly.. But not when the page is ".loaded" inside the parent..
问题是一些按钮在ModalPopupExtenders(ajaxtoolkit)中。当我单独运行子页面(在父级之外)时,modalpopup和它的按钮完美地运行..但是当页面在父级内部是“。loading”时却不能。
The problems and what i've tried:
问题和我尝试过的:
-
If I set the modalPopupExtender to have no OkControlID and set the Ok button inside the div to run it's own event, it fires normally the click function, but after that the modalpopup div stays visible in the page forever (not in a popup way, just visible).
如果我将modalPopupExtender设置为没有OkControlID并在div中设置Ok按钮来运行它自己的事件,它会正常触发click函数,但之后modalpopup div永远在页面中保持可见(不是以弹出方式,只是可见)。
-
If i set the modalPopupExtender to have OkControlID and an OnOkScript I just can't make the button to fire the OkScript...
如果我将modalPopupExtender设置为具有OkControlID和OnOkScript,我就无法使该按钮触发OkScript ...
The entire DIV to be shown is inside an updatepanel
要显示的整个DIV位于更新面板内
2 个解决方案
#1
If you set the BehaviorID in your ModalPopupExtenders control, you can use JQuery to display/hide the modal popup.
如果在ModalPopupExtenders控件中设置BehaviorID,则可以使用JQuery显示/隐藏模式弹出窗口。
eg
$find("behaviorid").show()
$find("behaviorid").hide()
In this case, you don't need to set OkControlID. After your button click events finishes, just call $find("behaviorid").hide()
在这种情况下,您不需要设置OkControlID。按钮单击事件完成后,只需调用$ find(“behaviorid”)。hide()
#2
In my case I have modalpopupextender in user control. And I load user control dynamic and multiple instance of that user control meaning I have multiple instances of modalpopupextender loaded dynamic. How do I set behaviorid so I can call .add_shown method to call some javascript on modal popup load ?
在我的情况下,我在用户控制中有modalpopupextender。我加载用户控件动态和该用户控件的多个实例意味着我有多个modalpopupextender加载动态实例。我如何设置behaviorid所以我可以调用.add_shown方法在模态弹出加载上调用一些javascript?
#1
If you set the BehaviorID in your ModalPopupExtenders control, you can use JQuery to display/hide the modal popup.
如果在ModalPopupExtenders控件中设置BehaviorID,则可以使用JQuery显示/隐藏模式弹出窗口。
eg
$find("behaviorid").show()
$find("behaviorid").hide()
In this case, you don't need to set OkControlID. After your button click events finishes, just call $find("behaviorid").hide()
在这种情况下,您不需要设置OkControlID。按钮单击事件完成后,只需调用$ find(“behaviorid”)。hide()
#2
In my case I have modalpopupextender in user control. And I load user control dynamic and multiple instance of that user control meaning I have multiple instances of modalpopupextender loaded dynamic. How do I set behaviorid so I can call .add_shown method to call some javascript on modal popup load ?
在我的情况下,我在用户控制中有modalpopupextender。我加载用户控件动态和该用户控件的多个实例意味着我有多个modalpopupextender加载动态实例。我如何设置behaviorid所以我可以调用.add_shown方法在模态弹出加载上调用一些javascript?