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 August 20th, 2004, 12:17 AM
Friend of Wrox
 
Join Date: Jun 2004
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?

 
Old August 20th, 2004, 12:35 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

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 ?
 
Old August 20th, 2004, 12:41 AM
Friend of Wrox
 
Join Date: Jun 2004
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!
 
Old August 20th, 2004, 09:00 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old August 20th, 2004, 09:39 AM
Friend of Wrox
 
Join Date: Jun 2004
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?

 
Old August 20th, 2004, 09:57 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old August 20th, 2004, 03:46 PM
Friend of Wrox
 
Join Date: Jun 2004
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?

 
Old August 21st, 2004, 05:04 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old August 22nd, 2004, 07:53 PM
Friend of Wrox
 
Join Date: Jun 2003
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





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





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