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 a Link? At the lowest level, a network can have of two or more computers directly linked by some physical medium such as coaxial cable or optical fiber. Such a physical

Checking for validity of an expression - C# Program Hello can you please provide me some examples regarding to the Checking for validity of an   expression in C#.

Finding Average of Array Elements - C# Program I need assignment help for Finding Average of Array Elements in C#. Can anybody send me there ideas?

Explain Component diagrams Package: - The Package logically make group of element of a UML model. Component: - It is the actual physical module or implementation of

I need help figuring out how to capture text box values from C# ASP.NET and send them from one class to another after being processed by a method.

We need in ASP.NET Mvc site I have project should be done with MVC.NET technology. In general- I have by now the site Layout (Html-js-css) I need- a) Simple CMS allo

#question.cookies working with data.

What is DISCO? DISCO is a method developed by Microsoft to publish and discover Web services. It discovers URLs of all XML Web services located on a Web server and develops a

What are Daemon threads? Daemon thread's run in the background and stop automatically when nothing is running program. The Example of a Daemon thread is the "Garbage collector"

What is a project baselines? The Project base line defines a logical closure of any deliverable or cycle. For example you have done the requirement phase with sign off from the