Click here to Skip to main content
14,981,762 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to know how to disable browser back button using java script in asp net mvc5,even i don't want to be back button clickable.Its only show back button in non clickable mode.

I have paste code, but its not sufficient as per my requirement..tell me the way how to make it.

What I have tried:

function DisableBackButton() {
window.history.forward()
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() }
window.onunload = function () { void (0) }
Posted
Updated 13-Aug-17 23:39pm
v2

1 solution

This is the most frequently asked question on the whole internet, please do basic research before asking a question

disable back button - Google Search[^]

Spoiler alert: you can't.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900