Solved

asp.net + previous page before postback

Posted on 2004-08-18
3
440 Views
Last Modified: 2012-06-21
i have a page that i am using for the user to sign into the site, what i want to do is after they have signed in, it will redirect them back to the page they just came from.  The problem i get the page they came from, but once they click sign in button the page postbacks and then i get the url for the page they are currently on.  how can i get and use the page before the postback happens

i tired using backpage = Page.Request.UrlReferrer  but as i said as soon as they click sign in button page postback and lose the actual page they had come from

Thanks
0
Comment
Question by:dkilby
  • 2
3 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 11838600
Hi,

you can use the forms authentication and then when the user is not authorized he/she is redirected to the login page with a value within the querystring that keep the referrer. then you can use FormsAuthentication.RedirectFromLoginPage method which ( as describes in MSDN ) : Redirects an authenticated user back to the originally requested URL.



Regards,
B..M
0
 
LVL 21

Expert Comment

by:tovvenki
ID: 11839265
Hi,
one another way is to save the value of Page.Request.UrlReferrer  in session and use the value in the session when you want to redirect to the page that they came from. Because without saving the value if the user postbacks then the value of Page.Request.UrlReferrer will change so you can't redirect the user to the page they came from.

Regards,
venki
0
 
LVL 21

Accepted Solution

by:
tovvenki earned 500 total points
ID: 11839347
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question