Export (0) Print
Expand All

Roles.Enabled Property

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)

'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>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft