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

How do u deploy ur project?

0 Answers   HCL, Microsoft,


What is the function of the ViewState property?

0 Answers   MindCracker,


Who will magage un-managed code?

7 Answers   HP,


How many types of page.

5 Answers   TCS, Verinon Technology Solutions,


How ASP and ASP.NET page works? Explain about asp.net page life cycle?

0 Answers  






What was the difference between machine.config and web.config files

17 Answers   Assurgent, NIIT, TCS,


What is inproc mode in session?

0 Answers  


Can you explain autopostback?

0 Answers  


WHAT IS OBJECT POOLING

2 Answers   Fidelity,


What is Http handler?

5 Answers   Accenture,


RequiredFieldValidator--write code in javascript

3 Answers   Wipro,


We have 2 sites in which one site allows the user with out asking credentials and second one ask for credentials through a log page. What might be the configurations settings for both sites? We can use IIS and web.config files together.

1 Answers   ADITI,


Categories