Roles.Enabled Property
.NET Framework 2.0
Gets or sets a value indicating whether role management is enabled for the current Web application.
Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)
Roles Members
System.Web.Security Namespace
Assembly: System.Web (in system.web.dll)
'Declaration Public Shared ReadOnly Property Enabled As Boolean 'Usage Dim value As Boolean value = Roles.Enabled
/** @property */ public static boolean get_Enabled ()
public static function get Enabled () : boolean
Not applicable.
Property Value
true if role management is enabled; otherwise, false. The default is false.The following example shows the roleManager element in the system.web section of the Web.config file for an ASP.NET application. It specifies that the application uses a SqlRoleProvider instance and sets the enabled attribute to true.
<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="MyApplication" />
</providers>
</roleManager>
- System.Web.AspNetHostingPermission To get the value of the Enabled property in a hosted environment. Permission value: Medium.
Reference
Roles ClassRoles Members
System.Web.Security Namespace
Other Resources
Understanding Role ManagementCommunity Additions
ADD
Show: