Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 21st, 2005, 07:52 AM
Authorized User
 
Join Date: Feb 2005
Location: delhi, delhi, India.
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
Reply With Quote
  #2 (permalink)  
Old March 21st, 2005, 09:16 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
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);


Reply With Quote
  #3 (permalink)  
Old March 21st, 2005, 10:35 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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
Reply With Quote
  #4 (permalink)  
Old March 21st, 2005, 07:20 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #5 (permalink)  
Old April 27th, 2006, 01:47 AM
Registered User
 
Join Date: Apr 2006
Location: new delhi, new delhi, India.
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)
Reply With Quote
  #6 (permalink)  
Old April 27th, 2006, 02:18 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #7 (permalink)  
Old September 27th, 2007, 11:59 AM
Registered User
 
Join Date: Sep 2007
Location: , , .
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...

Reply With Quote
  #8 (permalink)  
Old September 27th, 2007, 03:22 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
================================================== =========
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.