Click here to Skip to main content
Licence CPOL
First Posted 8 Jun 2009
Views 11,909
Bookmarked 7 times

JQuery.UI Dialog with ASP.NET empty post values

By | 8 Jun 2009 | Technical Blog
I ran into an issue using a jQuery.UI.Dialog control on an ASP.NET web form today. When defining a dialog, jQuery.UI takes the dialog and appends it right before the closing tag.
A Technical Blog article. View original blog here.[^]

I ran into an issue using a jQuery.UI.Dialog control on an ASP.NET web form today. When defining a dialog, jQuery.UI takes the dialog and appends it right before the closing </body> tag. This is outside of the <form> tag causing any values you wanted from the form to be empty in your code-behind.

Here is the fix that worked for me:

$("#dialog").parent().appendTo("/html/body/form[0]");

This works great and the dialog now displays as expected, capturing the results in the code behind except I originally wanted the dialog wrapped in a UpdatePanel. In order to fix this issue, I created an empty div and appended the dialog content there:

$("#dialog").parent().appendTo("#dialog_target");

Not the results I expected. When the content refreshes, the dialog is messed up. The answer was to move the content panel inside of the dialog with the user control doing all the work!!!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

trottin

Software Developer (Senior)

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 8 Jun 2009
Article Copyright 2009 by trottin
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid