为什么我的 ModalPopupExtender 不显示? ASP.NET 和javascript
我正在尝试从 javascript 调用模式弹出扩展程序。这是调用:
function MyFunction()
{alert("test");
$find('mdlPassword').show;}
调用时我收到警报,但模式弹出扩展程序不会显示。这是 aspx 的东西:
<!-- Popup Extenders Should Go Here -->
<asp:button id="Button1" runat="server" text="Button" style="display: none;" />
<asp:ModalPopupExtender ID="mdlPassword" runat="server"
targetcontrolid="Button1" popupcontrolid="pnlPassword"
popupdraghandlecontrolid="PopupHeader" drag="true">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlPassword" style="display: none" runat="server">
<div class="PasswordPopup">
<div id="PopupHeader"> </div>
<div class="Controls">
<center><table><tr>
<td>Please enter your password:</td><td><input type="password" name="Password" /></td></tr>
<tr><td> </td>
<td><asp:linkbutton id="btnOK" runat="server" text="OK" /> <asp:linkbutton id="btnCancel" runat="server" text="Cancel" /></td></tr></table></center>
</div>
</div>
</asp:Panel>
有什么想法吗?
谢谢,
杰森
I'm trying to call a modal popup extender from javascript. Here's the call:
function MyFunction()
{alert("test");
$find('mdlPassword').show;}
I get the alert when it's called, but the modal popup extender won't show. Here's the aspx stuff:
<!-- Popup Extenders Should Go Here -->
<asp:button id="Button1" runat="server" text="Button" style="display: none;" />
<asp:ModalPopupExtender ID="mdlPassword" runat="server"
targetcontrolid="Button1" popupcontrolid="pnlPassword"
popupdraghandlecontrolid="PopupHeader" drag="true">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlPassword" style="display: none" runat="server">
<div class="PasswordPopup">
<div id="PopupHeader"> </div>
<div class="Controls">
<center><table><tr>
<td>Please enter your password:</td><td><input type="password" name="Password" /></td></tr>
<tr><td> </td>
<td><asp:linkbutton id="btnOK" runat="server" text="OK" /> <asp:linkbutton id="btnCancel" runat="server" text="Cancel" /></td></tr></table></center>
</div>
</div>
</asp:Panel>
Any ideas?
Thanks,
Jason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试定义 ModalPopupExtender 的BehaviorID:
显示和隐藏弹出窗口的脚本:
Try to define the ModalPopupExtender's BehaviorID:
The script for showing and hiding the popup: