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: We require.NET ( C#.Net or VB.Net ) application to send whatsapp message : - The application could be connected to SQL server database to fetch the conta

Prepare .NET TWAIN application to control digital imaging sensor Project Description: We are seeking somebody to create a .NET TWAIN application which will activate a digital

I have a website with a photo gallery using PhotoHandler -photohandler.codeplex.com I require the code added/ modified to display the image file names under the preview or thumbnai

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Implement the service architecture using both .NET and Java technologies based on the following minimum requirements for this assessment. a.  The 'Parcel transaction service' mu

State the advantages of XML schemas over DTD. Microsoft developed a language called as the XML Schema Definition (XSD) to explain the schema to an XML document. The following a

Explain Windows authentication Schemes There are four parts of windows authentication I. Integrated Windows authentication II. Basic and basic with SSL authentication

What are the ways to implement locking in ADO.NET? There are many ways to implement locking using ADO.NET which are shown below:- 1)Whenever we call "Update" method of DataA

What is the difference between "DataSet" and "DataReader"? The major differences between "DataSet" and "DataReader" are as follows:- 1)The "DataSet" is a disconnected archit

Design an interface and add code to command buttons using case statement, to find coursework to be calculated using formula 0.6*1/6*total Mark