borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how to create the thumbnail of many images and dispaly those  thumbnail images in a particular web)Next Topic (how to develop a role base application from scratch ?) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : how to redirect user to his/her previous page ?
Poster Message
tri_inn
Level: Regular User
Registered: 26-08-2002
Posts: 395

icon how to redirect user to his/her previous page ?

suppose i don't know from which page the user has come to my page.my web form will have back button and when user wull click on back button then user will be redirected to his/her previous page.
how could i do it in asp.net.

05-07-2004 at 05:14 AM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: how to redirect user to his/her previous page ?

There are actually several ways of doing this.
You can use the Forms authentication mode in your project to redirect someone to the page they came from . this usually happens when you have protected areas of your site and you want to direct users to the login page when they try accessing these pages.

In this scenario the FormaAuthentication.RedirectFromLogin method implicitly takes care of it.

You could also use sessions in which you store the url from whic a person has come and then redirect from there. I think this is not ideal in most situations.

I simply use javascript's document.referrer
write a javascript function that will be called when the user clicks back. in the function ste the location  to the referrer and you are done

____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

07-07-2004 at 11:43 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ASP.Net : how to redirect user to his/her previous page ?
Previous Topic (how to create the thumbnail of many images and dispaly those  thumbnail images in a particular web)Next Topic (how to develop a role base application from scratch ?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder