21 Providers General Configuration
Configuration for 21 Providers for ASP.NET
You may choose to use all of the ASP.NET providers or just one. Below are the configuration sections defined for each different type of provider that you would like to use, and the different configuration settings that are available to them.
Database Connection String
In the web.config file for your application, you must add a connection string that defines how 21 Providers for ASP.NET accesses your Data Store.
<connectionStrings>
<!-- YOUR DATABASE CONNECTION STRING -->
<add name="T1cProvider"
providerName="THIS DEPENDS UPON YOUR DATA STORE"
connectionString="THIS DEPEND UPON YOUR DATA STORE"
/>
</connectionStrings>
The connection string and providerName that you provide here is going to be very specific to your RDBMS. Please visit the individual sections for information:
Membership Provider Configuration
To use the 21 Provider’s Membership Provider, you must include the following section to your <system.web> section of the web.config:
<membershipdefaultProvider="DbMembershipProvider">
<providers>
<addname="DbMembershipProvider"
type="T1c.AspNetProviders.DbMembershipProvider, T1c.AspNetProviders"
connectionStringName="T1cProvider"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
maxInvalidPasswordAttempts="10"
passwordAttemptWindow="30"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordStrengthRegularExpression="^.{7}$"
passwordFormat="Clear"
/>
</providers>
</membership>
There are many attributes that can be configured to get your membership provider working the way that you would like. All of the available ones are listed in the example above, and defintions on what many of the attributes can be found here:
The important attributes for getting the 21 Provider’s Membership provider working are the type and the connectionStringName. The type attribute is the fully qualified class name of the 21 Provider’s Membership provider. This should be left exactly as the example above. The connectionStringName attribute MUST BE IDENTICALto the value provided to the name attribute of the connectionStrings section of the web.config. In this example:
<connectionStrings>
<!-- SQL Server -->
<addname="T1cProvider"
From the connectionStrings section has the same name as:
connectionStringName="T1cProvider" from the membership section.
Role Provider Configuration
To use the 21 Provider’s Role Provider, you must include the following section in your <system.web> section of the web.config:
<roleManagerenabled="true"defaultProvider="DbRoleProvider">
<providers>
<addname="DbRoleProvider"
type="T1c.AspNetProviders.DbRoleProvider, T1c.AspNetProviders"
description="T1c Role Provider"
connectionStringName="T1cProvider"/>
</providers>
</roleManager>
Similar to the Membership configuration, the type and connectionStringName attributes are the most important. Leave type exactly as it is in this example, and make the connectionStringName attribute equal to the name of the connectionString added to the connectionStrings section of the web.config.
Profile Provider Configuration
To use the 21 Provider’s Profile Provider, you must include the following section in your <system.web> section of the web.config:
<profileenabled="true"defaultProvider="DbProfileProvider">
<providers>
<addname="DbProfileProvider"
type="T1c.AspNetProviders.DbProfileProvider, T1c.AspNetProviders"
description="T1c Profile Provider"
connectionStringName="T1cProvider"/>
</providers>
<properties>
<addname="FirstName"type="System.String"/>
<addname="LastName"type="System.String"/>
</properties>
</profile>
Similar to the Membership configuration, the type and connectionStringName attributes are the most important. Leave type exactly as it is in this example, and make the connectionStringName attribute equal to the name of the connectionString added to the connectionStrings section of the web.config. For more information about the rest of the profile information, please see:
Personalization Provider Configuration
To use the 21 Provider’s Personalization Provider, you must include the following section in your <system.web> section of the web.config:
<webParts>
<personalizationdefaultProvider="DbPersonalizationProvider">
<providers>
<addname="DbPersonalizationProvider"
type="T1c.AspNetProviders.DbPersonalizationProvider, T1c.AspNetProviders"
connectionStringName="T1cProvider"/>
</providers>
</personalization>
</webParts>
Similar to the Membership configuration, the type and connectionStringName attributes are the most important. Leave type exactly as it is in this example, and make the connectionStringName attribute equal to the name of the connectionString added to the connectionStrings section of the web.config. For more information about the rest of the web parts and personalization information, please see: