Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable the Back button of the browser

Posted on 1999-01-28
6
Medium Priority
?
209 Views
Last Modified: 2010-04-09
I am using ASP, with vbscript. I want to know a way to disable the back key of the browser ( IE3 +).
2nd part of the question is I would like it to be disabled only if I am abc.asp and it reactivate if traverse to other pages from abc.asp. If I come back to abc.asp the back should get redisabled.
0
Comment
Question by:anuravi
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:PBall
ID: 1845777
Nosiree.. No can't do that.

Button might not be on screen, but people can still press Alt+<- or right click and click Back.

uh uh.
0
 
LVL 3

Author Comment

by:anuravi
ID: 1845778
No Sir,
I have seen some sites where I go to and cannot click the back button to get back to the calling page???

0
 
LVL 6

Expert Comment

by:PBall
ID: 1845779
Are those pages called on a different window?

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
jhurst earned 200 total points
ID: 1845780
You can stop the back from working by including a
<meta http-equiv="refresh" content="0; url=the_real_page">
at the start of a copy of the page that you want to disable the back button in.

So for example, if your page is called dog.htm you would place the above code in the dog.htm except that the url= would become url=cat.htm.

Now, when the user selects dog he is immediately re-directed to cat.  If he hits a back in cat he will arrive at dog, but this will send him straight to cat again.  So he can not get back.  

This is why most people who use the <meta will set a refresh time greater than 0 so that people can go back.
0
 
LVL 3

Author Comment

by:anuravi
ID: 1845781
Jhurst,
I guess you are making sense. Thank you very much for providing such beatiful answer. I would try this approach and if I have question would post the question again.
Thanks

0
 
LVL 3

Author Comment

by:anuravi
ID: 1845782
Pball,
If you see jhurst's message, you would get what I am meant by asking the question. Probably my question was misleading...
Thanks.

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question