dialog and ASP.net

dialog and ASP.net


Hello,
With ASP.net, if we want to use server side button, we need to put it
inside the global <form> tag, there can be only one server side form
tag.
So if we use this piece of code.
<form runat="server">
<div id="modal">
<asp:Button runat="server" ID="btnTest"
onclick="btnTest_Click" />
</div>
<script type="text/javascript">
$('#modal').dialog({modal:true, autoOpen:false});
</script>
</form>
The button won't work because the modal will move the HTML in the
<body> tag outside the <form> tag.
A workaround to correct this problem is to modify the jqueryui
framework like this :
    open: function() {
        if (this._isOpen) { return; }
        var options = this.options,
            uiDialog = this.uiDialog;
        this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
        (uiDialog.next().length && uiDialog.appendTo('form')); // use form
instead of body
Of course, this is not a correct solution. The ideal solution is to be
able to define where to move the HTML.
Thanks