why should i use FormsAuthentication.RedirectFromLoginPage
(); Method in Form Authentication?Without using this method
also it's good??

Answers were Sorted based on User's Feedback



why should i use FormsAuthentication.RedirectFromLoginPage (); Method in Form Authentication?Withou..

Answer / uday kumar vuriti

FormsAuthentication.RedirectfromLoginPage() redirect the
user to the requested page without redirecting to default page.

Assume that we have 4 Pages and we are using forms
authentication with Login Page as Login.aspx and default
Redirection after Login Page as Home.aspx

MyApp/Login.aspx
MyApp/Home.aspx
MyApp/Profile.aspx
MyApp/Inbox.aspx

With FormsAuthentication.RedirectfromLoginPage():

If user requested for MyApp/Profile.aspx with out
Authentication Cookie(Login), he will be redirected to Login
Page and then after Login he will be redirected to
MyApp/Profile.aspx.

With out FormsAuthentication.RedirectfromLoginPage():

If we are not using
FormsAuthentication.RedirectfromLoginPage() then If user
requested for MyApp/Profile.aspx with out Logging in, he
will be redirected to Login Page and then after Login he
will be redirected to MyApp/Home.aspx.


the difference here is direct redirection of user to the
requested page.

Is This Answer Correct ?    9 Yes 0 No

why should i use FormsAuthentication.RedirectFromLoginPage (); Method in Form Authentication?Withou..

Answer / irfanpathan

to get the login page directly into our page we use this FormsAuthentication.RedirectfromLoginPage(). with out using this mehod also we can get the login page through WWT through drag and drop

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More ASP.NET Interview Questions

What is view state and how this can be done and was this there in asp ?

3 Answers   Accenture, BirlaSoft, CTS, Mphasis,


What is asp net application object?

0 Answers  


Explain the boxing and unboxing concept in .net?

0 Answers  


What is the use of web.config? Difference between machine.config and Web.config?

5 Answers  


how can you handle "control is not part of this page " error?

3 Answers   FactorH,






Is it possible to migrate visual interdev design-time controls to asp.net?

0 Answers  


In which situation can you not use a viewstate?

0 Answers  


What kind of data can be stored in viewstate?

0 Answers  


What is the flow of processing of the request? : asp.net mvc

0 Answers  


In this case if exception occure in Database which catch block will be exexcuted?

1 Answers   Microsoft,


Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?

0 Answers  


What for use web.sitemap in asp.net?

1 Answers  


Categories