jquery对话框中的多个回发问题

本文关键字:问题 对话框 jquery | 更新日期: 2023-09-27 18:27:22

我正试图在jquery对话框中加载一个aspx页面并执行多次回发。在正在加载的aspx页面中有一个更新面板、网格视图和提交按钮。如果单击"提交",数据库将进行搜索,数据将显示在gridview中。工作良好。但是,如果再次单击该按钮,则会出现页面错误。页面脚本管理器状态问题。

JQuery代码

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;
    }

Div在调用页面加载对话框

<div id="popupcontainer" style="display:none">  
<asp:ScriptManager ID="ScriptManagerPopup" runat="server" ScriptMode="Release">
</asp:ScriptManager>
<div id="popup" style="display:none">
</div>              

Dialog aspx页面正在加载

<form id="form1" runat="server">
<div style="background-color: #C0C0C0; color: #000000; font-weight: bold">
Sub Account Search
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server"     EnablePartialRendering="true"     ScriptMode="Release" >
    </asp:ScriptManager>
<div id="Search">
<table class="style1">
    <tr>
        <td class="style4">
            HiNet Major Account #:</td>
        <td class="style6">
            <asp:TextBox ID="txtMajorAccount" runat="server" Width="263px">    </asp:TextBox>
        </td>
        <td>
            &nbsp;</td>
    </tr>
</table>
<table class="style1">
    <tr>
        <td class="style4">
            HiNet Minor Account #:</td>
        <td class="style6">
            <asp:TextBox ID="txtMinorAccount" runat="server" Width="263px">    </asp:TextBox>
        </td>
        <td>
            &nbsp;</td>
    </tr>
</table>
<table class="style1">
    <tr>
        <td class="style4">
            Legal Name:</td>
        <td class="style6">
            <asp:TextBox ID="txtLegalName" runat="server" Width="263px"></asp:TextBox>
        </td>
        <td>
            &nbsp;</td>
    </tr>
</table>
<table class="style1">
    <tr>
        <td class="style4">
            HiNet Minor Account Name:</td>
        <td class="style6">
            <asp:TextBox ID="txtAccountName" runat="server" Width="263px"></asp:TextBox>
        </td>
        <td>
            &nbsp;</td>
    </tr>
</table>
 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
<div id="AdditionalContent">
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound">
</asp:GridView>
</div>
<table class="style1">
<tr>
    <td class="style7">
        &nbsp;</td>
    <td class="style8">
        <asp:Button ID="btnSearch" runat="server" Text="Search" 
            onclientclick="btnSearch_Click" />
    </td>
    <td class="style9">
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
            onclientclick="javascript: return closeme();"  />
    </td>
    <td>
        &nbsp;</td>
</tr>
</table>
</div>
</ContentTemplate>
        </asp:UpdatePanel>
</form>

感谢您的帮助

jquery对话框中的多个回发问题

  $("popupcontainer").empty();

您可能需要$("#popupcontainer").empty();