This article discusses:
ASP.net 2.0 configuration file Provider
Building a custom Provider
Authentication and authorization
This article uses the following techniques:
asp.net, XML
With ASP.net 2.0, you can add authentication, authorization, and various configuration files to your Web site without writing code. This is obviously a huge step forward compared with the past. As with most new features in ASP.net 2.0, authentication, authorization, and configuration files have their own built-in providers. You can view a provider as a module that contains the methods used to complete a particular task. These providers are very flexible, and you can customize them by specifying properties. These specified properties pass information to the provider so that it performs a different action behavior. However, if you have a high degree of customization, you may want to replace the built-in version with a custom or Third-party provider.
The asp.net configuration file feature allows developers to specify settings or data for each user. All of this data can be stored in an anonymous configuration file so that the settings are retrieved without the user logging on to the site. However, if the user creates an account, these settings can also be migrated to the logged in profile. You can also choose to turn off the anonymous profile feature.
To store a user's profile properties and retrieve them, simply name each profile property and add it to the profile element in the Web.config file, as shown in Figure 1. This puts the profile properties into the settingspropertyvaluecollection of the configuration file. You can also specify a data type and a default value for each property.
Figure 1 web.config configuration file partition
<profile>
<properties>
<add name= "FirstName"/>
<add name= "LastName"/>
T;add name= "Address1"/> <add name= "Address2"/> <add name= "city"/> <add
"state
" />
<add name= "Zip"/>
<add name= "Phone"/> <add name=
"profileversion" type= "int" def Aultvalue= "0"
/>
</properties>
</profile>