views:

744

answers:

2

I have a page which loads children pages by using jQuery's .load function...

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..

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).

  • If i set the modalPopupExtender to have OkControlID and an OnOkScript I just can't make the button to fire the OkScript...

The entire DIV to be shown is inside an updatepanel

A: 

If you set the BehaviorID in your ModalPopupExtenders control, you can use JQuery to display/hide the modal popup.

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()

David
A: 

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 ?