amit shukla

amit shukla

  • NA
  • 78
  • 66.6k

Browser back button issue

Jan 4 2016 11:16 PM
Hello Friends
i want to disable browser back button in mvc not in jquery ( i.e. if we click on browser back button then previous page is not open . i have used some jquey code and this code is work but first , it display the previous page after that show the current page like below
 
<script type="text/javascript" language="javascript">
function DisableBackButton() {
window.history.forward()
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() }
window.onunload = function () { void (0) }
</script>
 
 
).
if any one has answer of this please share as soon as possible.
Thanks
Amit Shukla 
 

Answers (1)