11 February 2014

Disable browser back button using Javascript in ASP.NET

<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>

No comments:

Post a Comment