17.4. Implementing Registration and Login

The usual flow of a restricted site is that a user signs up for access by creating a user ID and password. After creating an account, the user can log in and poke around. In this section, you create the sign up (registration), login, and retrieve password pages.

17.4.1. Creating the Registration page with CreateUserWizard

Users create an account by navigating to a sign-up page. This step assumes that you've already created the Membership database in the preceding section. Follow these steps to create a registration page for the Small Business Starter Kit site:

  1. Making sure to select a master page, add an ASP.NET page named Register.aspx to the starter kit project.

  2. From the Login area of the Toolbox, drag a CreateUserWizard control and drop it inside ContentPlaceHolder1, as shown in Figure 17-5.

  3. Browse to Register.aspx and fill in the form to create a user.

    You can use the information in the following table if you want reminders of the details in later sections of the chapter.

    FieldValue
    User NameJohn Prince
    Passwordabc123#
    Confirm Passwordabc123#
    E-mailprince@kencox.ca
    Security QuestionWhat breed is Goldie?
    Security AnswerGoldenDoodle
  4. Click Create User.

    The form confirms your registration. If you didn't create the database, you get an error message. See the previous section, "Creating the Membership Database."

When complete, the form looks like Figure 17-6.

Figure 17-5. The CreateUser Wizard control handles sign-up details.
Figure 17-6. The completed ...

Get ASP.NET 3.5 For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.