Custom Form-Based Authentication in ASP.NET
page 4 of 7
by Steven Swafford
Feedback
Average Rating: 
Views (Total / Last 10 Days): 34479/ 42

Create the Default Registration, Login, and PasswordRetrieval Web Forms

Within your IDE, create the following Web forms and name them Registration.aspx, Login.aspx, and PasswordRecovery.aspx. Without writing any code, all you have to do is drag and drop the CreateUserWizard, Login, and PasswordRecovery controls from your toolbox onto the respective web form.

Figure 7: CreateUserWizard Control

Figure 8: Login Control

Figure 9: PasswordRecovery Control

At this point, it would worth mentioning the configuration behind this control is located in the machine.config file located within your .NET 2.0 framework installation directory (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG). If you open machine.config and look for the entry AspNetSqlMembershipProvider within the Membership node you will find the settings associated to creating new user accounts.

Listing 2: Default AspNetSqlMembershipProvider Settings

<add name="AspNetSqlMembershipProvider"

  type="System.Web.Security.SqlMembershipProvider,

        System.Web, Version=2.0.0.0, Culture=neutral,

        PublicKeyToken=b03f5f7f11d50a3a"

  connectionStringName="LocalSqlServer"

  enablePasswordRetrieval="false"

  enablePasswordReset="true"

  requiresQuestionAndAnswer="true"

  applicationName="/"

  requiresUniqueEmail="false"

  passwordFormat="Hashed"

  maxInvalidPasswordAttempts="5"

  minRequiredPasswordLength="7"

  minRequiredNonalphanumericCharacters="1"

  passwordAttemptWindow="10"

  passwordStrengthRegularExpression="" />

Now that I have touched on customizing the AspNetSqlMembershipProvider, let us now return to the Web forms we previously created and register a new user. As you will see, we have provided the capability for users to create an account, recover a forgotten password, and, finally, the login functionality all within a matter of minutes.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 7:01:38 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search