JavaScript to Disable Browser Back Button

1. Disable the page cache using the script on the server-side. The code is given below:
  1. Response.Buffer = true;  
  2. Response.ExpiresAbsolute = DateTime.Now.AddHours(-1);  
  3. Response.Expires = 0;  
  4. Response.CacheControl = "no-cache"
2. Disable the page cache to make the browser no longer save the cache of web pages on the client-side, mentioned as below:
  1. <head>  
  2.      <meta http-equiv="Expires" CONTENT="0">  
  3.      <meta http-equiv="Cache-Control" CONTENT="no-cache">  
  4.      <meta http-equiv="Pragma" CONTENT="no-cache">  
  5. </head> 
3. Use the javascript on the client-side to realize the forward effect, this counteracts the action of the user’s, clicking the back button. See the code given below:
  1. <script type="text/javascript">  
  2.    window.history.forward(1);  
  3. </script> 
For more details you may visit my blog: