Confirm Navigation Setting in Each Pages in ASP.NET Website

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.. 
  1. function closeIt() {  
  2.         return "Any string value here forces a dialog box to \n" +  
  3.              "appear before closing the window.";  
  4.     }  
  5.     window.onbeforeunload = closeIt;  
  6.    
  7. <body onbeforeunload="closeIt()"
Output :
 
 
Tech Blog Reference: Click here