How to do Forms authentication in asp.net?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between value type and reference type?

251


How you can manage the state of application at the server side in ASP.NET?

566


How to comment out asp.net tags?

627


What is the difference between stored procedure vs function?

569


What is work flow gen? how can it will work with .Net?

2571






What are the major built-in objects in ASP.NET?

565


Do you know using sql cache invalidation?

524


Explain different authentication modes in asp.net?

546


What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?

658


What is the difference between Classic ASP and ASP.Net?

524


Explain how dot net compiled code will become platform independent?

498


Why asp.net mvc is better than asp.net? : Asp.Net MVC

493


What are the server controls in asp.net?

454


What types of data validation events are commonly seen in the client-side form validation?

556


What is asp net theme?

514