 |
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
|
|
|

August 20th, 2004, 12:17 AM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

August 20th, 2004, 12:35 AM
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ?
|

August 20th, 2004, 12:41 AM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|

August 20th, 2004, 09:00 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|

August 20th, 2004, 09:39 AM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for all your response.
What if I have thousands of page? How can I automate this?
|

August 20th, 2004, 09:57 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|

August 20th, 2004, 03:46 PM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

August 21st, 2004, 05:04 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|

August 22nd, 2004, 07:53 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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
|
|
 |