17.5. Adding an Administration Area

The administration area is for managing the users and the site. You allow access to the area only to users with the Administrators role. The Small Business Starter Kit doesn't have built-in administration functions. In this section, you create a simple page as an administration starting point.

17.5.1. Adding the Admin folder and a page

It's easier to secure entire folders than individual pages. For that reason, all administrative pages go into an Admin folder. Follow these steps to create a folder:

  1. In Solution Explorer, create a new folder called Admin (WebsiteNew Folder).

  2. Making sure to select a master page, add an ASP.NET page named Memberlist.aspx to the Admin folder.

Next, you create a page for verifying administration security.

17.5.2. Building the Membership List page

As a starter for the Admin section, you allow administrators to view the membership list in a GridView control. Follow these steps to add and configure the GridView:

  1. In Design view, from the Data category of the Toolbox, drop a SqlDataSource control into the ContentPlaceHolder area of the Memberlist.aspx page.

  2. Using the ASPNETDB.MDF database that you created in the previous section, "Creating the Membership Database," configure the SqlDataSource according to the following table:

    SettingValue
    Data connectionASPNETDB.MDF
    Retrieve data fromvw_aspnet_MembershipUsers
    ColumnsEmail, UserName, ...

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.