zimcoder Level: VB Lord

 Registered: 27-10-2003 Posts: 225
|
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
 
|