I'm trying to set window.onbeforeunload to null for every asp Button as they are prompting my "Are you sure you want to close browser" message even they the button is just redirecting them.
$('#asp:button').click(function () {
alert("asp test working");
window.onbeforeunload = null;
});
So this is the above code i'm trying to access all asp:button to set window.onbeforeunload to null.
function confirmExit() {
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; }
And this is my prompt code.
For some reason, I can't get the first section code to work, the alert dont even appear!
Any pointers?