Solved

how to disable the back button on the browser

Posted on 2008-10-04
9
1,104 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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Read about why website design really matters in today's demanding market.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now