?
Solved

how to disable the back button on the browser

Posted on 2008-10-04
9
Medium Priority
?
1,119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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 1200 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 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