System.Web.Configuration Namespace
.NET Framework version 2.0
Configures an application for role management.
Visibility |
Name |
Value Type |
Accessibility |
public |
CacheRolesInCookie
|
Boolean |
[ Get , Set ] |
public |
CookieName
|
String |
[ Get , Set ] |
public |
CookiePath
|
String |
[ Get , Set ] |
public |
CookieProtection
|
CookieProtection |
[ Get , Set ] |
public |
CookieRequireSSL
|
Boolean |
[ Get , Set ] |
public |
CookieSlidingExpiration
|
Boolean |
[ Get , Set ] |
public |
CookieTimeout
|
TimeSpan |
[ Get , Set ] |
public |
CreatePersistentCookie
|
Boolean |
[ Get , Set ] |
public |
DefaultProvider
|
String |
[ Get , Set ] |
public |
Domain
|
String |
[ Get , Set ] |
public |
Enabled
|
Boolean |
[ Get , Set ] |
public |
MaxCachedResults
|
Int32 |
[ Get , Set ] |
public |
Providers
|
ProviderSettingsCollection |
[ Get ] |
|
The RoleManagerSection class defines configuration settings that are used to support the role management infrastructure of Web applications. This class cannot be inherited.
The RoleManagerSection class provides a way to programmatically access and modify the roleManager section of a configuration file.
This section provides two code examples. The first demonstrates how to declaratively specify values for several properties of the RoleManagerSection class. The second demonstrates how to use the RoleManagerSection type.
The following configuration file example shows how to declaratively specify values for several properties of the RoleManagerSection class.
<system.web>
<roleManager enabled = "false"
cacheRolesInCookie = "false"
cookieName = ".ASPXROLES"
cookieTimeout = "30"
cookiePath = "/"
cookieRequireSSL = "false"
cookieSlidingExpiration = "true"
createPersistentCookie = "false"
cookieProtection = "All"
defaultProvider = "AspNetSqlRoleProvider"
maxCachedResults = "25">
<providers>
<add name = "AspNetSqlRoleProvider"
connectionStringName = "LocalSqlServer"
applicationName = "/"
type = "System.Web.Security.SqlRoleProvider, System.Web,
Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
<add name = "AspNetWindowsTokenRoleProvider"
applicationName = "/"
type = "System.Web.Security.WindowsTokenRoleProvider, System.Web,
Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
</system.web>
ASP.NET Configuration <roleManager> Section ASP.NET Roles