Tuesday, July 28, 2009

Error in C#.Net 2 with ASP.Net 2. Automatically redirect to default.aspx. Please help me.?

I have developed user login page in my webpage. When I try to loging by FormsAuthentication.RedirectFromLoginPag... It automcatically redirect to Default.aspx. Following are my code.





if(Login()==true)


{


FormsAuthentication.RedirectFromLoginPag...


}


else


{


message.text="Invalid Loign. try again..."


}





My secure page name is UserHome.aspx which is in forlder UserHome. I want that user with go their home page after successfull login.....





I inherits login technique from http://msdn.microsoft.com/msdnmag/issues...








Its very urget Please help me.

Error in C#.Net 2 with ASP.Net 2. Automatically redirect to default.aspx. Please help me.?
What is your question?





The RedirectFromLoginPage method redirects to the URL specified in the query string using the ReturnURL variable name. For example, in the URL http://www.contoso.com/login.aspx?Return... the RedirectFromLoginPage method redirects tothe return URL caller.aspx. If the ReturnURL variable does not exist, the RedirectFromLoginPage method redirects to the URL in the DefaultUrl property.





ASP.NET automatically adds the return URL when the browser is redirected to the login page.





By default, the ReturnUrl variable must refer to a page within the current application. If ReturnUrl refers to a page in a different application or on a different server, the RedirectFromLoginPage methods redirects to the URL in the DefaultUrl property.If you want to allow redirects to a page outside the current application, you must set the EnableCrossAppRedirects property to true using the enableCrossAppRedirects attribute of the forms configuration element.

innia

No comments:

Post a Comment