| |||||||||||||||||||||||||||||||||||||||
<roleManager> SectionASP.NET Syntax ASP.NET Configuration Sections .NET Framework version 2.0 Configures an application for role management. <roleManager cacheRolesInCookie = "true | false" cookieName = "name" cookiePath = "/" cookieProtection = "All | Encryption | Validation | None" cookieRequireSSL = "true | false " cookieSlidingExpiration = "true | false " cookieTimeout = "number of minutes" createPersistentCookie = "true | false" defaultProvider = "provider name" domain = "cookie domain"> enabled = "true | false" maxCachedResults = "maximum number of role names cached" <providers>...</providers> </roleManager> Attributes and ElementsThe following sections describe attributes, child elements, and parent elements for this section. Attributes
Child Elements
Parent Elements
RemarksThe roleManager element configures an application for role management. For information about accessing and modifying configuration values for the roleManager element in application code, see RoleManagerSection. Default ConfigurationThe following default roleManager element is not explicitly configured in the Machine.config file or in the root Web.config file. However, it is the default configuration that is returned by the application. The providers are explicitly configured in the Machine.config file. <roleManager
enabled = "false"
cacheRolesInCookie = "false"
cookieName = ".ASPXROLES"
cookieTimeout = "30"
cookiePath = "/"
cookieRequireSSL = "false"
cookieSlidingExpiration = "true"
cookieProtection = "All"
defaultProvider = "AspNetSqlRoleProvider"
createPersistentCookie = "false"
maxCachedResults = "25">
<providers>
<clear />
<add
connectionStringName = "LocalSqlServer"
applicationName = "/"
name = "AspNetSqlRoleProvider"
type = "System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add
applicationName = "/"
name = "AspNetWindowsTokenRoleProvider"
type = "System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
ExampleThe following code example shows how to configure an ASP.NET application to use the SqlRoleProvider class to store and retrieve role information. <configuration>
<system.web>
<roleManager defaultProvider = "SqlProvider"
enabled = "true"
cacheRolesInCookie = "true"
cookieName = ".ASPROLES"
cookieTimeout = "30"
cookiePath = "/"
cookieRequireSSL = "false"
cookieSlidingExpiration = "true"
cookieProtection = "All" >
<providers>
<add name = "SqlProvider"
type = "System.Web.Security.SqlRoleProvider"
connectionStringName = "SqlServices"
applicationName = "SampleApplication" />
</providers>
</roleManager>
</system.web>
</configuration>
See AlsoASP.NET Configuration RoleManagerSection Class ASP.NET Roles |
| ||||||||||||||||||||||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme