Click here to Skip to main content
14,545,215 members
Rate this:
Please Sign up or sign in to vote.
See more:
what does the returnurl mean..

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

can anyone explanin this peace of code


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

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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[^]
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100