I am looking for a JavaScript modal dialog solution for asp.net, jquery UI dialog seems good but it move dialog container to bottom of body tag. I changed the dialog code to stay dialog to asp.net form but still it’s out of updatepanel.
Is there any solution or more compatible dialog that doesn’t break asp.net form lifecycle?
Thanks
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
When jquery creates a dialog its appends the dialog div to the body tag. And this effectively moves it outside the form tag and hence no post back. The solution is trivial and this blog http://blog.roonga.com.au/2009/07/using-jquery-ui-dialog-with-aspnet-and.html explains it with example.
Method 2
Why not put the UpdatePanel inside the dialog container?
Method 3
While I’m not sure that I know precisely what you are asking, Dave Ward has a couple of nice articles on this: http://encosia.com/2008/10/11/using-jquery-to-display-a-modal-updatepanel-confirmation/ and http://encosia.com/2008/10/04/using-jquery-to-enhance-aspnet-ajax-progress-indication/. Both articles use the jQuery BlockUI plug-in.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0