Click here to Skip to main content
15,917,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to redirect the user on the requested page which user enters in url. If the user is not looged in then first it user will requested to log in and then after it'll redirect to the same link... Can any onw help me out..? thanks in advance...
Posted

1 solution

1. Save the current page address in a session.
2. Redurect user to Login page.
3. after loging in, redirect the user to the address that has saved in the session.

To Get URL:
C#
string url = HttpContext.Current.Request.Url.AbsoluteUri; 


Or Look at this:
http://www.powerasp.net/content/new/get-current-page-url.asp[^]
 
Share this answer
 
v4
Comments
Naikniket 10-Mar-12 8:24am    
ok thank you but how to store the address in variable/session from url? i dont have any idea how to get url from address bar...?
Shahin Khorshidnia 10-Mar-12 8:33am    
string url = HttpContext.Current.Request.Url.AbsoluteUri;
Naikniket 10-Mar-12 8:59am    
thnak you.. i have got it...
Naikniket 10-Mar-12 8:59am    
request.url
Shahin Khorshidnia 10-Mar-12 9:02am    
you're welcome. Did my solution help?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900