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 August 20th, 2004, 12:17 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do you know which page to go to after sign up

Hello

When people browse the website then decide to register they go to registration page to do this. After registeration is complete then the user get redirected to the last page he was viewing before clicking on registration.aspx page.

How do you know which page was the last page before clicking registration or sign up page?

Reply With Quote
  #2 (permalink)  
Old August 20th, 2004, 12:35 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

I assume you have a piece of code in every page (possibly in an include file) which checks logged-in status and redirects to login page. This must be using the code

Response.Redirect "login.asp"

You can change this as below.

Response.Redirect "login.asp?redirect=" & Request.ServerVariables("SCRIPT_NAME")

Then in the login page, you can know from which page you came there. Request.QueryString("redirect") gives this value.

The rest you can do. Is n't it ?
Reply With Quote
  #3 (permalink)  
Old August 20th, 2004, 12:41 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

It is the good idea which madhukp is given that in every page checks logged-in status and redirects to login page




Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
Reply With Quote
  #4 (permalink)  
Old August 20th, 2004, 09:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bekim,

This is a classic ASP's Web_how_to forum.
Looks like you are looking for an ASP.Net related answer. You can post that in an ASP.NET forum under DOTNET category on the p2p.wrox.com homepage.

Though not so good at this, I think you got to make use of web.config and RedirectFromLoginPage() to achieve this.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #5 (permalink)  
Old August 20th, 2004, 09:39 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for all your response.
What if I have thousands of page? How can I automate this?

Reply With Quote
  #6 (permalink)  
Old August 20th, 2004, 09:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can always use the servervariable collections from where http_referer can help you et the URL of previous page from where you came on to this page. But If the page is redirected, HTTP_REFERER is empty.

Or you can use server variable HTTP_URL variable and store that in a session variable every time the user browses a page other than registration page. So that once the registration process is completed, you can make use of this session variable's value and redirect the user to that page. Remember, the HTTP_URL comtains only the virtual path reference.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #7 (permalink)  
Old August 20th, 2004, 03:46 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I realized that I posted this in ASP. I am using ASP.NET should I repost this question in ASP 1.1 or do these answer apply to ASP.NET?

Reply With Quote
  #8 (permalink)  
Old August 21st, 2004, 05:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Server variables are available in .Net too, so there shouldn't be any problem in doing that. Though my suggestion would work fine, there may be a better/easier way of doing this in .Net. Still, you can repost this on .Net forum, to get a better solution from there.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #9 (permalink)  
Old August 22nd, 2004, 07:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

If you are using forms auth, you can use

FormsAuthentication.RedirectFromLoginPage(..)

This should redirect you back to where you were. Automated all for you.

Brian
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
How use plus sign ajabbabahalmigiriha C# 1 December 19th, 2006 01:04 AM
SIGN OUT PROBLEMS.. sarah lee ASP.NET 1.0 and 1.1 Basics 2 October 26th, 2006 10:27 AM
The little "plus" sign janise Access 8 January 6th, 2005 10:10 AM
Is it possible to sign a VBScript - Need help ssudhaiyer VBScript 1 September 5th, 2003 05:10 AM
how % sign use in asp mateenmohd SQL Server 2000 2 July 28th, 2003 06:56 AM



All times are GMT -4. The time now is 03:59 AM.


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