Forms authentication, DOT NET Programming

Explain Forms authentication in detail.

In the old ASP if you were said to create a login page and do authentication you have to do lot of custom coding. But now in ASP.NET that is made easy by introducing Forms authentication. So let's view in detail what form authentication is.

The Forms authentication uses a ticket cookie to see that user is authenticated or not. That means that whenever  user is authenticated first time a cookie is set to tell that this user is authenticated.When  the cookies expire then Forms authentication mechanism sends the user to the login page.

The steps which define steps for Forms authentication are as follows:-

1) Configure Web.config file with forms authentication. As shown below in the config file you can see we have give the cookie name and loginurl page.

path="/" />

Remove the anonymous to access to the IIS web application, some changes are

Done to web.config file are as follows.

1) Create the login page which will accept the user information. You will have to create your login page that is the Login.aspx which will actually get the user data.

2) Finally a little bit coding in the login button.

Let's assume that the login page has2 textboxes: Txtname and txtapssword.

Also import the System.Web.Security and put the following code in the login button of the page.

If  Page.IsValid Then

If  FormsAuthentication.Authenticate(txtName.Text, txtPassword.Text) Then

FormsAuthentication.RedirectFromLoginPage(txtName.Text, False) Else

lblStatus.Text = "Error not proper user" End If

End If

Posted Date: 9/22/2012 6:42:00 AM | Location : United States







Related Discussions:- Forms authentication, Assignment Help, Ask Question on Forms authentication, Get Answer, Expert's Help, Forms authentication Discussions

Write discussion on Forms authentication
Your posts are moderated
Related Questions
Project Description: Program or Fan Page Poster for facebook fan pages. Major task of this program would be posting pictures on your facebook fan page from other users fan pa

CTS(Common Type System) : In order that the two language communicate smoothly CLR has CTS (Common Type System). Example in VB you have "Integer" and in C++ you have "long" these d

How to use datagrid view

What are the criteria necessary for an effective and efficient network? a. Performance It can be measured in several ways, including transmit time and response time. b

What are Value types and Reference types The Value types directly contain their data which are either allocated on the stack or allocated in-  Line in a  structure. The Refe

What are the different Visual Basic features that support LINQ? Visual Basic includes the following features that support LINQ: Anonymous types - Enables you to make a ne

How many types of diagrams are there in UML? There are nine types of diagrams in the UML as shown below:- 1)Use case diagram: The use case diagram describe "WHAT" of a

Question: (a) Explain the function of the main .NET data objects: Connection, Command, DataReader, DataAdapter, DataSet, DataTableCollection, and DataView. (b) Describe h

I need a Custom Report - Crystal Reports Project Description: I am seeking a custom report for our syrinx hire software, all reports are made from Crystal Reports. Skills

How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method? To Call the Dispose method in the Finalize method and in the Dispose