I am trying to show an asp:ModalPopupExtender using jQuery, without any success. Here is what I have :
ASP.NET
<asp:ModalPopupExtender BehaviorID="confirmPopup" ID="confirmPopup" runat="server" />
JAVASCRIPT
function ShowConfirmPopup() {
var _id = '#<%= confirmPopup.ClientID %>';
var modal = $find(_id);
modal.show();
}
What happens is that modal
is always equal to null
, so the popup never gets shown. What am I doing wrong?
$find() is not part of jQuery, but of ASP.NET AJAX. Therefore, you should not prefix the behavior id with a hash sign:
function ShowConfirmPopup()
{
var modal = $find("confirmPopup");
modal.show();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With