Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2005, 07:52 AM
Authorized User
 
Join Date: Feb 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Disabling Back button of browser

 Dear Users ,

 I am in a fix ..

 I want to disable Back button of browser .
 What i want is , if some user is navigating in my website
 then if he clicks the back button of the browser the he should not able to see the back page of the browser ..

 regards

 Kamal Kant Singh
 +91-9810481159

__________________
Cheers :
K K Singh.
+91-9810481159

Why to be GOOD when U have the ability to be GREAT
 
Old March 21st, 2005, 09:16 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You cant disable back button of the browser.You can fix this issue by checking for history.go().-1 means previous screen and 0 means current screen.So whenever user presses back he will be redirected to the current page.code snippet is below

if(history.go(-1))
    history.go(0);


 
Old March 21st, 2005, 10:35 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

yeah, you cant disable the back button in a browser. best thing to do is open a new window with no toolbars

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
 
Old March 21st, 2005, 07:20 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;;best thing to do is open a new window with no toolbars

This wont work, pressing f12 brings them back

Why would you want to disable the back button? Web users are used to the back button

Wind is your friend
Matt
 
Old April 27th, 2006, 01:47 AM
Registered User
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to deepakbachelor
Default

we can not simply disable browser button.But we con do like that for handling back button.Simply Add this code to every page where u want handle back button.

<script language="JavaScript">
<!--
javascript:window.history.forward(1);
//-->
</script>

Deepak Kumar Sharma
PGMS Inc(Noida)
 
Old April 27th, 2006, 02:18 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

deepakbachelor:
There are so many what if's with what you are saying. It has been covered so many times on so many forums IMO why flog this horse 11 months later (time between your post and the previous)?

You can not control the back button. Just when you think youve cracked it somebody uses another browser... is JS disabled... are you aware of what f12 does... I could keep on going but will not.

Wind is your friend
Matt
 
Old September 27th, 2007, 11:59 AM
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you decide to open ur site in mini browser with toolbars disabled, tis possible to disable the f12 button, tis also possible to disable the ctrl button so the user is only gonna use the buttons u make available to him, this would work with any of the browsers too.

Just javascript...

 
Old September 27th, 2007, 03:22 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This has to be one of the most asked questions. There is no bullet proof way to do this so, as such, you should not rely on X functionaility for a particular porition of your site to work. What wilkanah is proposing will work...if the user has not disabled javascript.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling the BACK button by writing jsp code sumon_24_feb JSP Basics 3 July 14th, 2006 12:41 AM
browser back button Dj Kat Javascript How-To 1 February 22nd, 2006 06:33 AM
Effects of Browser Back Button prafullprashant ASP.NET 1.0 and 1.1 Basics 0 November 23rd, 2005 02:32 AM
Browser back button karetaker ADO.NET 2 November 5th, 2004 02:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.