Issues with multiple postbacks in jquery dialog
<p>I'm trying to load a aspx page in a jquery dialog and perform multiple postbacks. In the aspx page that is being loaded is a updatepanel, gridview and submit button. If you click submit db is search and data is displayed in gridview. Works fine. However if click the button again, page errors. Page script manager state issue.</p>

<p>JQuery Code</p>

<pre><code>function PopUpSearch() {
        $("popupcontainer").empty();
        $("#popup").load("/UI_Reference/SubAccountSearchPopUp.aspx").dialog({     autoopen: false, modal: true, width: 700,             
            open: function (type, data) {
              $(this).parent().appendTo("popupcontainer");               
            }
        });            
        return false;
    }
</code></pre>

<p>Div on calling page to load dialog</p>

<pre><code>&lt;div id="popupcontainer" style="display:none"&gt;  
&lt;asp:ScriptManager ID="ScriptManagerPopup" runat="server" ScriptMode="Release"&gt;
&lt;/asp:ScriptManager&gt;
&lt;div id="popup" style="display:none"&gt;
&lt;/div&gt;              
</code></pre>

<p></p>

<p>Dialog aspx page being loaded</p>

<pre><code>&lt;form id="form1" runat="server"&gt;

&lt;div style="background-color: #C0C0C0; color: #000000; font-weight: bold"&gt;
Sub Account Search
&lt;/div&gt;
&lt;asp:ScriptManager ID="ScriptManager1" runat="server"     EnablePartialRendering="true"     ScriptMode="Release" &gt;
    &lt;/asp:ScriptManager&gt;

&lt;div id="Search"&gt;
&lt;table class="style1"&gt;
    &lt;tr&gt;
        &lt;td class="style4"&gt;
            HiNet Major Account #:&lt;/td&gt;
        &lt;td class="style6"&gt;
            &lt;asp:TextBox ID="txtMajorAccount" runat="server" Width="263px"&gt;    &lt;/asp:TextBox&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;table class="style1"&gt;
    &lt;tr&gt;
        &lt;td class="style4"&gt;
            HiNet Minor Account #:&lt;/td&gt;
        &lt;td class="style6"&gt;
            &lt;asp:TextBox ID="txtMinorAccount" runat="server" Width="263px"&gt;    &lt;/asp:TextBox&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;table class="style1"&gt;
    &lt;tr&gt;
        &lt;td class="style4"&gt;
            Legal Name:&lt;/td&gt;
        &lt;td class="style6"&gt;
            &lt;asp:TextBox ID="txtLegalName" runat="server" Width="263px"&gt;&lt;/asp:TextBox&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;table class="style1"&gt;
    &lt;tr&gt;
        &lt;td class="style4"&gt;
            HiNet Minor Account Name:&lt;/td&gt;
        &lt;td class="style6"&gt;
            &lt;asp:TextBox ID="txtAccountName" runat="server" Width="263px"&gt;&lt;/asp:TextBox&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
 &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"&gt;
        &lt;ContentTemplate&gt;

&lt;div id="AdditionalContent"&gt;

&lt;asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound"&gt;

&lt;/asp:GridView&gt;

&lt;/div&gt;
&lt;table class="style1"&gt;
&lt;tr&gt;
    &lt;td class="style7"&gt;
        &amp;nbsp;&lt;/td&gt;
    &lt;td class="style8"&gt;
        &lt;asp:Button ID="btnSearch" runat="server" Text="Search" 
            onclientclick="btnSearch_Click" /&gt;
    &lt;/td&gt;
    &lt;td class="style9"&gt;
        &lt;asp:Button ID="btnCancel" runat="server" Text="Cancel" 
            onclientclick="javascript: return closeme();"  /&gt;
    &lt;/td&gt;
    &lt;td&gt;
        &amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/ContentTemplate&gt;
        &lt;/asp:UpdatePanel&gt;

&lt;/form&gt;
</code></pre>

<p>Thanks for your help</p>
