javascript – 使用jQuery显示asp:ModalPopupExtender

我试图使用jQuery显示一个asp:ModalPopupExtender,但没有任何成功.这是我有的:

ASP.NET

<asp:ModalPopupExtender BehaviorID="confirmPopup" ID="confirmPopup" runat="server" />

JAVASCRIPT

function ShowConfirmPopup() {
    var _id = '#<%= confirmPopup.ClientID %>';
    var modal = $find(_id);
    modal.show();
}

会发生什么是模态始终等于null,因此弹出窗口永远不会显示.我究竟做错了什么?

解决方法:

$find()不是jQuery的一部分,而是ASP.NET AJAX.因此,您不应该在行为id前面加上一个井号:

function ShowConfirmPopup()
{
    var modal = $find("confirmPopup");
    modal.show();
}

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...