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.history.forward();
}
DisableBack();
window.onload = DisableBack;
window.onpageshow = function(evt)
{
if (evt.persisted) DisableBack();
}
window.onunload = function() { void (0); }
</script>