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

In What scenarios you use a DOM parser and SAX parser? 1) If you do not require all the data from the XML file then SAX approach is most preferred than DOM as DOM can quiet mem

Need to copy values from one database to another AND Enhancements in MVC website. Project Description: Basically, you are asked to create an app that copy values from one DB

Project Description: I have a site that's previously fully developed, and need to fix some small problems (Text editor posting error, and a Server error caused by some Nhibernat

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?

What is "AutoPostBack" feature in ASP.NET? If we want to control the automatically postback in case of any event, we will need to check the attribute as true. For example on a

I want a Panel for youtube views and facbook likes. I need a panel made that can increase facebook fanpage likes, and that will increase youtube video views. Youtube views an

What does Address Of operator do? The Address Of operator generates a delegate object for the BackgroundProcess method. A delegate within VB.NET is a object-oriented, type-safe

Question: (a) Outline four classes that allow you to work with File Streams. (b) (i) What potential problem can arise when you change items stored in an Application State

I need Ninjatrader Strategy Project Description: UI for managing orders, entering trades. This project will probably take several months and I need dedicated resources. Sk