Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling IE Back Button

 
ShivPrakash Srivastava
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to resscrict the user going to the previous page using IE back button.It tried following solution but did not work

1.
response.setHeader("Cache-Control","no-cache"); //Forces caches to obtain a new copy of the page from the origin server
response.setHeader("Cache-Control","no-store"); //Directs caches not to store the page under any circumstance
response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility

2. history.forward()

3. window.<onload>=history.go(1)

Pls help.Thanks in Advance

Regards
Shiv
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.

The browser's back button is there for users to navigate within and across different web sites. It is not for a developer or designer of any particular site to decide whether or not a user can do this.

You should build your app in such a way that it can gracefully handle back button and refresh button clicks. Those things are out of your control.

Also, please see:
http://faq.javaranch.com/java/UseRealWords .
'pls' is not a word in the English language.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic