Solved

how to disable the back button on the browser

Posted on 2008-10-04
9
1,107 Views
Last Modified: 2012-05-05
Hello Experts,

I am trying to develop online test tool in ASP.NET, I have used Ajax lookup to get the questions and 4 multiple answers for it. It seems to be working fine. However, the problem is, I can use the back button on the browser navigate to the previously answered question and change or view the answer. I would like to completely disable the back button on the browser as long as they are with in the test application(pages).

Please can someone advise if there is any trick/logic to do this?

Thanks for your help.

Regards
Kay
0
Comment
Question by:learningnet
9 Comments
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22643568
:) no you cant ...

Refer this site for some alternative

http://www.irt.org/script/311.htm
0
 

Author Comment

by:learningnet
ID: 22643596
Thanks for your Comment.

However, none of the suggestion from that article worked for me ...
0
 
LVL 5

Assisted Solution

by:WesleySaysHi
WesleySaysHi earned 100 total points
ID: 22643720
You can set up a two-frame format that has one frame set to 100% and the second  to zero.

<FRAMESET COLS="100%,*">
<FRAME SRC="goback.html">
<FRAME SRC="fillerpage.html">
</FRAMESET>

The page "goback.html" contains only the code:

<META HTTP-EQUIV="refresh" CONTENT=".0; URL=nobackpage.html">

When the user logs in and the two frames load, the page "goback.html" redirects the 100% frame to jump to a new page, "nobackpage.html". If the user clicks "Back", the "goback.html" page loads and the "nobackpage.html" page pops right back up.

The above method is called "Frame Trap" and is the most used method to disable the back button on the browser.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 29

Expert Comment

by:Badotz
ID: 22644255
Why in the world would you want to do this?

If you play God with a Poor User's browser, then you deserve all of the wrath they throw your way.
0
 
LVL 29

Accepted Solution

by:
Badotz earned 300 total points
ID: 22644260
You would be better served to keep track of the answered questions, and check some variable to disallow the page to be displayed. You could then redisplay the current page.

Be aware that users (me) do *not* like to be forced to go in any one direction. If I want to go back a page, you should accomodate me. What you show me is up to you, but you should not (ever?) prevent me from back-tracking.
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 100 total points
ID: 22647178
" I would like to completely disable the back button on the browser "

ABSOLUTELY IMPOSSIBLE.

Rewrite the browser code -- if you can't do that, the answer is ABSOLUTELY IMPOSSIBLE.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22647208
Of course it is impossible. It is the reasoning I'm after.

Just another control freak who thinks he can coerce the Poor User into following his way of thinking. Fraught with peril. Pointless, too.

But the young will have their say, eh?
0
 
LVL 1

Expert Comment

by:Wrathyimp
ID: 24846596
Dear WesleySaysHi,

i would like to know your method of two iframes:
<FRAMESET COLS="100%,*">
<FRAME SRC="goback.html">
<FRAME SRC="fillerpage.html">
</FRAMESET>
The page "goback.html" contains only the code:

<META HTTP-EQUIV="refresh" CONTENT=".0; URL=nobackpage.html">

What is the fillerpage.html?, is it the page where we put our conents?
Under goback.html page can we point the nobackage.html to our start page?
Or do we need to creat a blank "nobackpage.html" page?
by my understanding there will be 4 pages:
1. index.html (having frameset)
2. goback.html
3. nobackpage.html
4. fillerpage.html (content page for the iframe)

Yes this comments is on very old post, but if you can reply, will help me alot.

Thanks all.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 24848394
A Google search returns

Results 1 - 50 of about 37,300 English pages for frame trap disable back button. (0.36 seconds)

There should be something of interest in that haystack, eh?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

828 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