when the user leaves the page I want to give message do you want to leave. I am handling this in function pageUnload() event in javascript.But I don't want to call this in the page postback I want to call when they navigate to different page
Look into window.onbeforeunload
.
Note that Firefox 4 and up will not present the custom message to the user (but they do present a dialog asking if the user wants to leave). Safari, Chrome, and IE will.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.