Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 August 16th, 2007, 09:23 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending user to previous page

Need assistance... I'm trying to find out the best method for sending a user back to the "previous" page that they were on...

Scenario... I have an "contact us" page that has an option to "cancel" ... what I want to do is send the user back to the previous page that "referred" to the "contact us" page. I've tried several methods etc for the "click" event in the code behind file. I'm coding in C#, ASP 2.0, VS 2005.

Appreciate any assistance.

Thanks

 
Old August 16th, 2007, 05:52 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I think you want the history object. It doesn't grab the URL, but it does allow you to navigate back.

http://msdn2.microsoft.com/en-us/library/ms535864.aspx#

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old August 17th, 2007, 01:04 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well in simple terms, you can use the history object of javascript on the click event of button, like,

history.back(-1)

This will take the user to the previous page.

Regards
Mike

Don't expect too much, too soon.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to expire previous page johnsonlim026 ASP.NET 1.0 and 1.1 Basics 6 May 22nd, 2009 12:05 PM
Find previous page gandaliter PHP How-To 2 June 7th, 2007 11:55 AM
Previous Page equal's Nothing jamara ASP.NET 2.0 Professional 9 February 14th, 2007 03:46 PM
Page 1-2-3-4 etc.... Next and Previous buttons crmpicco Classic ASP Basics 1 March 18th, 2005 12:00 PM
logout the previous session for the same user Beulah VS.NET 2002/2003 2 October 15th, 2004 05:04 AM





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