9

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

3 Answers 3

24

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I know this answer is almost 3 years old, but I couldn't leave without commenting. This works well IF "modal" is set to false. If the dialog was created with modal = true, then a transparency layer will be created. Simply moving the dialog's parent within the form will leave it behind, blocking all the actions altogether. Still, your answer is much valid (and it helped me a lot, thanks :D).
4

Why not put the UpdatePanel inside the dialog container?

2 Comments

I add an UpdatePanel inside the dialog. the dialog work OK but previous UpdatePanel doesn't update. I Update both UpdatePanel Manually but only one UpdatePanel Update.
You have to call .Update() on all of the panels that you want updated in the code behind.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.