Solved

how to disable the back button on the browser

Posted on 2008-10-04
9
1,101 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
Comment Utility
:) no you cant ...

Refer this site for some alternative

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

Author Comment

by:learningnet
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 29

Accepted Solution

by:
Badotz earned 300 total points
Comment Utility
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
Comment Utility
" 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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)

762 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

13 Experts available now in Live!

Get 1:1 Help Now