1

I want to disable browser's back button after login in asp.net. I tried to put javascript like window.history.forward(1) function or Response.Cache function. That coding works in my web application. But back button is not disabled. How to do that?

2
  • 1
    Even if this was possible, your users would HATE you for doing it. Nov 24, 2012 at 15:38
  • and why do your want to do it. Any requirement Nov 24, 2012 at 16:50

3 Answers 3

0

We cannot disable browser back button.You can try below code, it may help:-

 <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

 <META HTTP-EQUIV="EXPIRES" CONTENT="0">

 <meta http-equiv="pragma" content="no-cache">
0

This is not possible. Back history is maintained by browser, you will need to close the window.

3
  • Back history is accessible however using JS (window.history). Nov 24, 2012 at 15:38
  • Not after closing the window.
    – nothrow
    Nov 24, 2012 at 16:01
  • No but he doesn't want to close the window. He wants to disable the back button after somebody logs in so that they can't try and go back to the login page, if I understand correctly. Nov 24, 2012 at 17:41
0

Maybe you could just redirect logged in user to your desired page like a user dashboard or something when they go back to your login page? You could use sessions to determine logged in users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.