Solved

asp.net + previous page before postback

Posted on 2004-08-18
3
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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