Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
|
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 July 28th, 2004, 03:21 AM
Authorized User
 
Join Date: Apr 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default history.back or hitting the back button won't work

hi!!

how come when I hit the back button in the browser's page, or put a button in my page using history.back, they won't work?

hope someone could help me on this..thanks!
 
Old July 28th, 2004, 05:24 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

May I know what error are you getting ? Are you getting a "Page expired" message which tells you to hit the refresh button ? If this is the case, then you may be submitting a form in post method to the previous page. You may be preventing the page to go to cache. In that case you cannot prevent this. This is a browser security feature. You may have to change the submission method of form to Get (if possible).

If the behaviour is not like this, please specify what exactly happening when you hit back button. You may give a piece of code in the page also.
 
Old July 28th, 2004, 07:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

When using a link, I do:

<a href="javascript:history.go(-1)">Back</a>

history.back I don't think is supported by all browsers, but history.go is.

Brian
 
Old July 29th, 2004, 12:08 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default


  or u can use button.

<input type='button' value='Back' onclick='javascript:history.back();'>

If you want to appear as a link use CSS

<style>
input {border-style:solid;border-width:0;background-color:your current background;cursor:hand;}

</style>

 
Old July 29th, 2004, 12:14 AM
Authorized User
 
Join Date: Apr 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi! Thanks for all those who replied. I tried using history.back but it won't work. Then I found out the calling page contains a javascript which prevents other pages to go back to it..thanks!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Back Button j_rumpa Javascript How-To 8 July 4th, 2007 08:29 AM
How to prevent Back History after Sing Out my site hatem ASP.NET 1.0 and 1.1 Basics 2 December 28th, 2006 02:55 AM
Preventing Data Loss when hitting back button IronStar Javascript How-To 8 July 23rd, 2005 07:00 PM
Back Button DARSIN General .NET 0 March 1st, 2005 08:00 AM
history.back(-1); elania Javascript How-To 3 February 2nd, 2005 03:14 PM





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