Zesty
Zesty

Reputation: 3001

How to disable the back button without relying on Javascript?

I've seen some web sites like banking applications that prevent the user from using the back button. If I remember correctly, when you press the back button your session times out.

How can I do this?

Upvotes: 0

Views: 580

Answers (2)

Andreas Grech
Andreas Grech

Reputation: 108040

No, don't do that; don't surprise the user. The back button is there so it can be used. If that's a problem for you, find a way around it, not prevent it.

Use the Post/Redirect/Get pattern @benjynito mentioned in the comment.

Upvotes: 2

Govind Malviya
Govind Malviya

Reputation: 13763

You cant disable browser's back button just use that, I found here

Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

Upvotes: 1

Related Questions