Roles.Enabled 속성

정의

현재 웹 애플리케이션에 역할 관리를 사용할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

true역할 관리를 사용하도록 설정하면 이고, 그렇지 않으면 . false 기본값은 false입니다.

예제

다음 예제에서는 ASP.NET 애플리케이션에 대한 Web.config 파일 섹션의 system.web 요소를 보여줍니다. 애플리케이션에서 인스턴스를 SqlRoleProvider 사용하도록 지정하고 특성을 enabled.로 설정합니다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>

적용 대상

추가 정보