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

时间:2012-03-09 21:26:01

标签: c# jquery asp.net

我正在尝试在jquery对话框中加载aspx页面并执行多个回发。在正在加载的aspx页面中是一个updatepanel,gridview和submit按钮。如果单击提交db,则搜索并在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 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>

感谢您的帮助

1 个答案:

答案 0 :(得分:1)

  $("popupcontainer").empty();

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