I have a window.onbeforeunload event that I wish to disable when I am clicking on a specific hyperlink.
I am using the following JQuery:
$(function() {
$("a#<%= lockUnlock.ClientID %>").click(function() {
window.onbeforeunload = null; });
});
But when I click on other links the event doesn't fire.
Is there any way around this?
EDIT (more info):
I am using asp.net
lockUnlock is a link button which is on an update panel. The link button is pressed, after the partial page back the window.onbeforeunload doesn't work anymore.