Hi, I'd like my application to return to the previous page after logging in, but I don't know how to do that. So if you're on the default.aspx and then you click the login button which brings you to login.aspx, after you login i would like my code to send
you back to default.aspx. Could someone tell me how to do this from the code behind file. The code below doesn't work, but am I close? Thank you.
None
0 Points
60 Posts
redirecting to URL of previous page
Apr 06, 2005 01:09 PM|em23|LINK
Hi, I'd like my application to return to the previous page after logging in, but I don't know how to do that. So if you're on the default.aspx and then you click the login button which brings you to login.aspx, after you login i would like my code to send you back to default.aspx. Could someone tell me how to do this from the code behind file. The code below doesn't work, but am I close? Thank you.
Dim Current_Url As UriCurrent_Url = HttpContext.Current.Request.Url
Response.Redirect(Current_Url)
Member
166 Points
291 Posts
Re: redirecting to URL of previous page
Apr 06, 2005 11:19 PM|Ahmed Abu Dagga|LINK
when you made login button write current page as query string in login url and use this querystring in login page.
if you are put your login button in custom user control use Page.Request.Path to get current page
I hope this help