模态弹出服务器端处理

时间:2012-08-08 11:40:46

标签: javascript asp.net ajax modalpopupextender

我尝试使用ajax模态弹出窗口但是当我点击目标按钮时没有任何事情发生!!

protected void ibtn_login_Click(object sender, ImageClickEventArgs e)
        {
                    .........
                    pnl_email.Visible = true;
                    this.mod_email.Show();
                    .........

        }

<asp:Panel ID="pnl_email" runat="server" Visible="false">
        <table border="0" align="right" cellpadding="0" cellspacing="0" class="MainTable">
            <tr>
                <td align="left">
                    <label>
                        UserMail<font color="red"> *</font></label>
                </td>
                <td align="left">
                    <asp:TextBox ID="txt_email" runat="server" Width="350px" ValidationGroup="E"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*"
                        ControlToValidate="txt_email" ValidationGroup="E">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txt_email"
                        ErrorMessage="Invalid mail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        ValidationGroup="E">*</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <asp:Button ID="btn_confirmMail" runat="server" Text="Confirm Mail" OnClick="btn_confirmMail_Click"
                        ValidationGroup="E" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:ModalPopupExtender ID="mod_email" runat="server" TargetControlID="ibtn_login" 
        PopupControlID="pnl_email" BackgroundCssClass="modalBackground" DropShadow="true"
        OkControlID="btn_confirmMail">
    </asp:ModalPopupExtender>

我从IE收到以下错误:

  

SCRIPT87:参数无效。   的ScriptResource.axd d = 92AV6VxPb6EpSOraO2TfCghg2URfn_e1UnUMJeJSBpUklUTQUPbjulsV4_SUVHYavVKrhWStNKamtzKpd-i0CMF0IZIaiu5Rsqsi2-YgiWOQswz5wtr2VOzzJrpNOMeTHlqd4KNSoOxi2-yulEg6OaXbmIU1&安培;ΔT= ffffffff9b7d03cf,   第1262行第13行

2 个答案:

答案 0 :(得分:2)

mod_email.show()我认为你正在寻找

另外,试试

在asp:Panel中包装更新面板或将内容放在updatepanel中 <asp:Panel ID="pnl_email" runat="server" Visible="false"> {
{1}} {
{1}} {
{1}} {
{1}} {
{1}}
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> {
{1}} {
{1}}

答案 1 :(得分:1)

确保您的网页上有 scriptmanager

<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>