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 애플리케이션에 system.web 대한 Web.config 파일의 섹션에 있는 roleManager 요소를 보여줍니다. 애플리케이션에서는 지정는 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>

적용 대상

추가 정보