我有一个modalpopUpExtender并尝试弹出ATM的列表 以下代码显示ASP面板我想要弹出窗口
<asp:Panel ID="pnlBanks" CssClass="atmBnkPopup" runat="server" meta:resourcekey="pnlBanksResource1">
<div id="pnlBanksCnt" style="display: none;">
<h2 class="sectionHeading">
<asp:Literal ID="litATMPaymentHeader" runat="server" meta:resourcekey="litATMPaymentHeaderResource1"
Text="ATM Payment (Indonesia)" />
</h2>
<asp:Literal ID="litATMPaymentText" runat="server" meta:resourcekey="litATMPaymentTextResource1" />
<br />
<div style="text-align: center;">
<asp:LinkButton ID="lbCloseBanks" runat="server" meta:resourcekey="lbCloseBanksResource1"
Text="<img
alt="Close" src="images/btn/btn-close.gif" __designer:mapid="5f" />" />
</div>
</div>
<asp:Button ID="btnBanks" runat="server" Style="display: none;" meta:resourcekey="btnBanksResource1" />
</asp:Panel>
<cc1:ModalPopupExtender ID="mpeBanks" runat="server" TargetControlID="btnBanks" CancelControlID="lbCloseBanks"
PopupControlID="pnlBanks" BackgroundCssClass="modalBackground" DynamicServicePath=""
Enabled="True" />
在Aspx页面中,尝试调用JavaScript以弹出屏幕
<p>
<asp:Literal ID="litATMBanks" runat="server" Text="To view the banks at which we accept ATM payment," meta: resourcekey="litATMBanksResource1" />
<a href="javascript:ShowBankList();">
<asp:Literal ID="litATMBanksLink" runat="server" Text="click here" meta: resourcekey="litATMBanksLinkResource1" />
</a>
</p>
这是我的Java脚本
function ShowBankList() {
var modal = $find("mpeBanks");
if (modal) {
$("pnlBanksCnt").style.display = "block";
modal.show();
}
}
我将Modal视为null。 我不确定代码中缺少什么。为什么$找不到元素