jQuery modal form dialog postback problems jQuery modal form dialog postback problems asp.net asp.net

jQuery modal form dialog postback problems


After creating your dialog simply move the dialog back into your form. Example:

 $("#divSaveAs").dialog({bgiframe:false,                            autoOpen:false,                            title:"Save As",                            modal:true});    $("#divSaveAs").parent().appendTo($("form:first"));

This worked for me. Postback works find.


Be aware that there is an additional setting in jQuery UI v1.10. There is an appendTo setting that has been added, to address the ASP.NET workaround you're using to re-add the element to the form.

Try:

$("#dialog").dialog({ autoOpen: false, height: 280, width: 440, modal: true, appendTo:"form" });


"AppendTo" option works to me.

$("#dialog").dialog({ ..., appendTo:"form" });

See: http://api.jqueryui.com/dialog/#option-appendTo