Figure 13.10. Creating an application setting
<appSettings>
<add key="AdminEmail" value="admin@dorknozzle.com" />
</appSettings>
To access this data, you need to use the ConfigurationManager class, which is
located in the System.Configuration namespace, like this:
Visual Basic
adminEmail = ConfigurationManager.AppSettings("AdminEmail")
C#
adminEmail = ConfigurationManager.AppSettings["AdminEmail"];
Creating Users and Roles
Open the ASP.NET web site, click the Security tab, and click Enable Roles under
the Roles section. This will add the following line to your Web.config file:
554
Chapter 13: Security and User Authentication
File: Web.config (excerpt)
<roleManager enabled="true" />
Two new links will appear under Roles: Disable Roles, and Create or Manage Roles.
Click Create or Manage Roles, and use the form shown in Figure 13.11 to create
two roles: one named Users, and another named Administrators.
Figure 13.11. Creating roles
555
Creating Users and Roles

Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, Second Edition 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.