我试图使用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();
}