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
What is Language Integrated Query (LINQ)? LINQ is a programming model that is the composition of general-purpose standard query operators that permit you to work with data, reg

Describe the rules and regulations that must be followed whereas creating a well-formed XML document. The following are the rules and regulations that are essential to follow w


Site minder Authentication in SharePoint We have fit site minder agent in SharePoint 2010. We would like to have incorporate with site minder agent. Currently site-minder age

What is a Cloud Service? A cloud service is used to build cloud applications. This service gives the facility of using the cloud application without installing it on the comput

Which command-line tool generates code and mapping for the LINQ to SQL component of .NET Framework? The SqlMetal.exe command-line tool generates code and map the LINQ to SQL co

Project Description: The website should be CMS based; coding done only on ASP, MySql databases, .net script, aspx and java use with least of the flash work. We will be sharing j

I want Text/Image printing Counter Project Description: Need your help in our C# programming project. We need to pass this project in two weeks starting from now to pass our

Define Network? A network is a set of devices linked by physical media links. A network is recursively is a connection of two or more nodes by a physical link or two or more

As its name suggests, the website builder must be a desktop application that will allow users to simply create websites. Essentially, the program will have to give the users with a