?
Solved

asp.net + previous page before postback

Posted on 2004-08-18
3
Medium Priority
?
446 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 2000 total points
ID: 11839347
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

840 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