0

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?

Zesty
  • 2,894
  • 8
  • 34
  • 63
  • 3
    Let me recommend Post/Redirect/Get pattern use . Besides that just build in some safe guards for double posts. – John Hoven May 03 '11 at 11:11

2 Answers2

2

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.

Andreas Grech
  • 102,667
  • 98
  • 290
  • 358
1

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

Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
Community
  • 1
  • 1
Govind Malviya
  • 13,257
  • 16
  • 67
  • 91