Roles.Enabled Eigenschaft

Definition

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob die Rollenverwaltung für die aktuelle Webanwendung aktiviert ist.

public:
 static property bool Enabled { bool get(); };
public:
 static property bool Enabled { bool get(); void set(bool value); };
public static bool Enabled { get; }
public static bool Enabled { get; set; }
static member Enabled : bool
static member Enabled : bool with get, set
Public Shared ReadOnly Property Enabled As Boolean
Public Shared Property Enabled As Boolean

Eigenschaftswert

truewenn die Rollenverwaltung aktiviert ist; andernfalls . false Der Standardwert lautet false.

Beispiele

Das folgende Beispiel zeigt das roleManager-Element im system.web Abschnitt der Web.config-Datei für eine ASP.NET Anwendung. Es gibt an, dass die Anwendung eine SqlRoleProvider Instanz verwendet und das enabled Attribut auf 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>

Gilt für:

Weitere Informationen