How to do Forms authentication in asp.net?

Answers were Sorted based on User's Feedback



How to do Forms authentication in asp.net?..

Answer / sivasaravanan

in webconfig file

<authentication mode="Forms">
<forms cookieless="UseCookies"
loginUrl="~/LoginInformation.aspx" timeout="10">
<credentials passwordFormat="Clear">
<user name="Siva" password="siva"/>
<user name="joseph" password="jos"/>
</credentials>
</forms>
</authentication>

After In a aspx.cs page you have write a below coding

if (FormsAuthentication.Authenticate(TextBox1.Text,
TextBox2.Text))
{
Response.Write("Hi Joseph");
}
else
{
Response.Write("Please Create account");
}

Is This Answer Correct ?    6 Yes 0 No

How to do Forms authentication in asp.net?..

Answer / tiger skumar

I have tested the above one . Its working fine.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Can you edit data in the Repeater control?

11 Answers   CAC, Creative,


What is the difference between table and query?

0 Answers  


how to get modified rows from Dataset

1 Answers   CGI,


What is boxing and unboxing ?

7 Answers   Accenture, Infosys, MedTek,


What are type/key pairs in client script registration?

0 Answers  






Where do we store our connection string in asp.net application?

0 Answers  


Which method is used to force all the validation controls to run?

0 Answers  


On what object is the transaction in ADO.NET focused on? a) The command object b) The DataSet object c) The Connection object d) The DataAdapter object

4 Answers   Syntax Softtech,


how can u create the forms authentication?and what is the difference between forms authentication and windows authentication?

2 Answers   IBM,


• What Session State providers are available in ASP.NET? What are the pros and cons of each?

2 Answers   Infosys,


Is session server side or client side?

0 Answers  


Why does a user need nothing more than a Web browser to view ASP.NET pages?

1 Answers  


Categories