-2

in my asp.net c# code I'm not manage any session,cooks values.After click submit button redirect into dashboard page in dashboard page how can i disable back button

Chenna Rao
  • 111
  • 3
  • 11
  • 2
    Possible duplicate of [how to stop browser back button using javascript](http://stackoverflow.com/questions/12381563/how-to-stop-browser-back-button-using-javascript) – Nikhil Vartak Nov 04 '15 at 05:36

1 Answers1

2

Put this code on your dashboard page.

<script type="text/javascript">
    function DisableBackButton() {
         window.history.forward()
    }
    DisableBackButton();
    window.onload = DisableBackButton;
    window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() }
    window.onunload = function () { void (0) }
</script>
Kaushik Maheta
  • 1,741
  • 1
  • 18
  • 27