单击按钮时,弹出窗口有时不起作用。问题出在哪里? -Asp.net

时间:2010-08-05 18:00:57

标签: c# asp.net html

为什么弹出窗口有时不起作用。弹出窗口没有条件。只要点击一个按钮,它就必须弹出。你们认为问题可能在哪里?

谢谢,

                                

              

<table id="pnlPopupAdditional" runat="server" style="display:none">
    <tr>
        <td>
            <asp:Panel runat="server" CssClass="modalPopup">
                <table width="350" height="80" class="warningPopup">
                    <tr>
                         <td>
                            <!-- <img src="images/warning_blue.gif" alt="Warning" /> -->
                        </td>
                        <td colspan="2" align="left" style="padding-left: 75px; padding-top: 10px;">
                            <asp:Literal ID="ltMessage" runat="server"></asp:Literal>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="4">
                            <input id="btnYesAdditional" type="button" value="YES" class="popupButton" />
                            <input id="btnNoAdditional" type="button" value="NO" class="popupButton" />
                        </td>
                    </tr>
                </table>

            </asp:Panel>
        </td>
    </tr>
</table>
<asp:Button ID="btn" runat="server" Visible="false" />

private void SetAdditionalLocationMessage()     {         _AccountSummary accountSummary = new _AccountSummary();         accountSummary = new Merchant2()。GetAccountSummary(MerchantID);

    if (accountSummary != null)
    {
        if (accountSummary.PackageID != (int)CommonHelper.Package.Free )
            btnAdd.Visible = true;
        else 
            btnAdd.Visible = false;
    }

    if (new Merchant2().IsLocationCountExceed(MerchantID))
    {
        string locationFee = new Merchant2().GetAdditionalLocationFee(accountSummary.PackageID).ToString();
        ltMessage.Text = String.Format(ApplicationData.MSG_ADDITIONAL_LOCATION_CHARGE, locationFee);

        ModalPopupExtender1.TargetControlID = "btnAdd";
        ConfirmButtonExtender1.TargetControlID = "btnAdd";
    }
    else
    {
        ModalPopupExtender1.TargetControlID = "btn";
        ConfirmButtonExtender1.TargetControlID = "btn";
    }
    //Controls_UC

protected void btnAdd_Click(object sender,ImageClickEventArgs e)     {         MerchantID = CommonHelper.GetLoggedInMerchant();

    string QueryString = ApplicationData.URL_MERCHANT_COMPANY_PAYMENT + "?MerchantProfilePages";

    Response.Redirect(QueryString);

1 个答案:

答案 0 :(得分:0)

这可能是在AJAX请求期间处理JavaScript引用的DOM元素的结果。

这假设您正在获取通过pnlPopupAdditional.ClientID引用的DOM元素的JavaScript引用,以便您可以修改display:none;样式声明。