Monday, March 26, 2012

Causing Async Postback after closing ModalPopup

Hey,

Im trying to make use of the ModalPopupExtender in order to allow the user to input some information and then have an UpdatePanel async postback to update with this new information. The key here would therefore be to Update the Panel right after closing the ModalPopup. This is where Im having some troubles. No matter what I cant get the UpdatePanel to postback after clicking Ok from the ModalPopup. As of right now, once you click Ok from the Modal, you have to hit refresh in order to see the results of the info... which kinda defeats the purpose of AJAX.

Thanks in advance for help!

Hi,

You can first add an invisible button on the form, and set it as the triggerfor the UpdatePanel.

Then, add a OnOkScript to the modalPopupExtender. In the script, call click on the invisible button. Like this: $get("id of the invisible button").click

So, whenever the modalPopup is closed via clicking on ok button, the UpdatePanel is able to update.

Hope this helps, and please feel free to let me know if there is any problem.

No comments:

Post a Comment