Solved

asp.net + previous page before postback

Posted on 2004-08-18
3
439 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

821 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