Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
1.17/5 (4 votes)
See more:
what does the returnurl mean..

i googled it but not get the understanding to if..

can anyone explanin this peace of code


C#
<pre> if (User.Identity.IsAuthenticated && Request.QueryString["ReturnUrl"] != null)
        {
            Response.Redirect("NotAuthorized.aspx");
        }
Posted

1 solution

When using Forms Authentication, and navigating to a page that requires
authentication should redirect to the login.aspx page (or a page specified in the <forms loginurl=""> tag in the web.config file)... .NET will automatically append your login.aspx with ?ReturnUrl=[page the user tried to access un-authenticated].

This is a good read to understand (section: Forms Authentication Control Flow)

http://msdn.microsoft.com/en-us/library/aa480476.aspx[^]
 
Share this answer
 
Comments
RaviRanjanKr 15-Sep-11 17:43pm    
Nice Answer, My 5+
Pradeep Shukla 15-Sep-11 17:44pm    
Thanks Ravi ;-)
rkthiyagarajan 15-Sep-11 20:18pm    
Very Nice..its usefull.

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