Introduction
This blog describes how to Confirm navigation settings on each page in the Asp.net website.
Code :
//Put this script inside the Master page..
- function closeIt() {
- return "Any string value here forces a dialog box to \n" +
- "appear before closing the window.";
- }
- window.onbeforeunload = closeIt;
-
- <body onbeforeunload="closeIt()">
Output :