Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disable back button

Posted on 2010-11-23
16
Medium Priority
?
447 Views
Last Modified: 2012-05-10
On all or any of the browsers, is there a way to completely DISABLE the back button for the browser

OR

Intercept the attempt and do something else (as in...do nothing)  ??

If not via ASP.NET or javascript....are there 3rd party controls or software that do this?  What about browser plugins?
0
Comment
Question by:Tom Knowlton
[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
  • 4
  • 3
  • 2
  • +5
16 Comments
 
LVL 33

Expert Comment

by:jppinto
ID: 34198961
You can't change the behavior of the browser but you can try this:

http://www.4guysfromrolla.com/webtech/111500-1.shtml

jppinto
0
 
LVL 33

Accepted Solution

by:
jppinto earned 288 total points
ID: 34198978
0
 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 288 total points
ID: 34199169
well all you need to do is disable history or clear it at each page access....

<SCRIPT LANGUAGE=javascript>
{

  var Backlen=history.length;   history.go(-Backlen);
  window.location.href=page url

 }

</SCRIPT>
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 52

Assisted Solution

by:_agx_
_agx_ earned 288 total points
ID: 34199223
(no points ...)

AFAIK there's no 100% bullet-proof way to do that.  It begs the question is why do you want to disable it? Often the reason is something that could be better handled another way.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 34199302
I cannot speak to the "why" at this point.

I was just asked to research "can you do it" and "how"

I realize it is anti-social and uncooth.

I think it is just one particular page we want to make it difficult for them, where going back would have some fairly serious consequences (for their transaction, for example).
0
 
LVL 7

Assisted Solution

by:dxdinh
dxdinh earned 284 total points
ID: 34199407

 I came across a cool jquery plug in and back space - you can disable it totally. Checkout jquery bbq plugin from Ben Alman

http://benalman.com/projects/jquery-bbq-plugin/

 you can try the demo - try to backspace on his demos - such a cool plugin

http://benalman.com/code/projects/jquery-bbq/examples/fragment-advanced/#bbq1=burger.html
0
 
LVL 52

Expert Comment

by:_agx_
ID: 34199770
@knowltonknowlton

Yeah, I understand.  Usually when the question comes up it's because something non-trivial is involved. That is why I said there's no 100% sure way to do it.  Not in a standard html page.  

>> I think it is just one particular page we want to make it difficult for them, where going
>> back would have some fairly serious consequences (for their transaction, for example).

I don't know the structure of your pages. But its sounds like you're talking about a page processes a transaction. So you want to prevent users from reloading it (ie paying 2x). Usually a better way to handle that is with redirects: either server or client side. Server side redirects don't show up in the client browser at all and with the correct headers, client side redirects would not either.

0
 
LVL 52

Expert Comment

by:_agx_
ID: 34200044
Btw: When I say server vs client redirect I'm not talking about javascript
http://msdn.microsoft.com/en-us/library/x3x8t37x.aspx

The link in jppinto's post briefly touches on redirects.  IMO it's better than depending on javascript (which can be disabled).  But IIRC, all methods (except server side transfers) can be circumvented.  

If as you say, you're only trying to make it more difficult, those methods might suffice. But bottom line: if something catastrophic will happen if technique xyz fails, then .. expect it to happen and handle it in code.  Because those darned "users" always seem to find ways to make the "impossible" .. "possible" ;-)
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 34200145
http://benalman.com/projects/jquery-bbq-plugin/


WHERE is the demo, exactly?  ::: lost ::::
0
 
LVL 52

Expert Comment

by:_agx_
ID: 34202488
I think it's the 2nd link dxdinh posted.
0
 
LVL 7

Expert Comment

by:dxdinh
ID: 34202552
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 34202612
0
 
LVL 7

Assisted Solution

by:mr_nadger
mr_nadger earned 284 total points
ID: 34204386
isn't there something in the accessibility ratings for websites which precludes turning the page back off? If so, you might want to check if your site requires a high rating
0
 
LVL 29

Assisted Solution

by:Kumaraswamy R
Kumaraswamy R earned 284 total points
ID: 34205041
use
in aspx page

<SCRIPT LANGUAGE=javascript>
  window.history.forward();    
</Script>
0
 
LVL 21

Assisted Solution

by:Alpesh Patel
Alpesh Patel earned 284 total points
ID: 34217525
You cannot disable the button but override the back action using removing the history. by loading the same page on click of back button of explorer.
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 34232785
thx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

670 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