Disabling Browser Back Button using Javascript.

Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 212
The below sample Javascript code used to disable the browser back button in the Asp.Net applications.So that we can restrict the user to go back by pressing the browser back button.

<script type = "text/javascript">

function DisableBack()

window.onload = DisableBack;

window.onpageshow = function(evt)
if (evt.persisted) DisableBack();
window.onunload = function() { void (0); }


Comments or Responses

Login to post response