profile 요소(ASP.NET 설정 스키마)

[이 설명서는 미리 보기 전용이며, 이후 릴리스에서 변경될 수 있습니다. 비어 있는 항목은 자리 표시자로 포함됩니다.]

ASP.NET 프로필을 사용하여 사용자 프로필 값을 관리하기 위한 매개 변수를 구성합니다.

이 요소는 .NET Framework 버전 2.0에서 새로 도입되었습니다.

<profile
    enabled="true|false"
    inherits="fully qualified type reference"
    automaticSaveEnabled="true|false"
    defaultProvider="provider name">
    <properties>...</properties>
    <providers>...</providers>
</profile>

특성 및 요소

다음 단원에서는 특성, 자식 요소 및 부모 요소에 대해 설명합니다.

특성

특성

설명

enabled

선택적 Boolean 특성입니다.

ASP.NET 사용자 프로필의 사용 여부를 지정합니다. true이면 ASP.NET 사용자 프로필이 사용됩니다.

기본값은 true입니다.

defaultProvider

선택적 String 특성입니다.

기본 프로필 공급자의 이름을 지정합니다.

자세한 내용은 Provider를 참조하십시오.

기본값은 AspNetSqlProfileProvider입니다.

inherits

선택적 String 특성입니다.

ProfileBase 추상 클래스에서 파생되는 사용자 지정 형식에 대한 형식 참조가 포함되어 있습니다. ASP.NET에서는 이 형식에서 상속되는 ProfileCommon 클래스를 동적으로 생성하여 현재 HttpContextProfile 속성에 배치합니다.

automaticSaveEnabled

선택적 Boolean 특성입니다.

ASP.NET 페이지 실행이 끝나면 사용자 프로필을 자동으로 저장할지 여부를 지정합니다. true이면 ASP.NET 페이지 실행이 끝날 때 사용자 프로필이 자동으로 저장됩니다.

ProfileModule 개체는 모듈에서 프로필이 수정되었음을 감지하는 경우에만 사용자 프로필을 저장합니다. 즉, IsDirty 속성이 true인 경우입니다. 자세한 내용은 ASP.NET Profile Properties Overview를 참조하십시오.

기본값은 true입니다.

자식 요소

요소

설명

properties

필수적 요소입니다.

사용자 프로필 속성 및 속성 그룹의 컬렉션을 정의합니다.

providers

선택적 요소입니다.

프로필 공급자의 컬렉션을 정의합니다.

부모 요소

요소

설명

configuration

공용 언어 런타임 및 .NET Framework 응용 프로그램에서 사용하는 모든 구성 파일의 필수 루트 요소를 지정합니다.

system.web

ASP.NET 구성 섹션의 루트 요소를 지정합니다.

설명

응용 프로그램 코드에서 profile 요소의 구성 값에 액세스하여 수정하는 방법에 대한 내용은 ProfileSection을 참조하십시오.

기본 구성

다음의 기본 profile 요소는 .NET Framework 버전 2.0의 Machine.config 파일에 구성되어 있습니다.

<profile>
  <providers>
        <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
  </providers>
</profile>

예제

다음 코드 예제에서는 ASP.NET 응용 프로그램에서 SqlProfileProvider 공급자를 사용하도록 Web.config 파일을 구성하는 방법을 보여 줍니다.

<configuration>
  <connectionStrings>
    <add name="SqlServices" connectionString="Data Source=localhost;Integrated Security=SSPI;Initial 
         Catalog=aspnetdb;" />
  </connectionStrings>

  <system.web>
    <authentication mode="Forms" >
      <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
    </authentication>

    <authorization>
      <deny users="?" />
    </authorization>

    <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear/>
        <add name="SqlProvider" 
             type="System.Web.Security.SqlMembershipProvider" 
             connectionStringName="SqlServices"
             applicationName="SampleApplication"
             enablePasswordRetrieval="true"
             enablePasswordReset="true"
             passwordFormat="Encrypted"
             requiresQuestionAndAnswer="true" />
      </providers>
    </membership>

    <profile defaultProvider="SqlProvider">
      <providers>
        <clear />
        <add name="SqlProvider"
             type="System.Web.Profile.SqlProfileProvider"
             connectionStringName="SqlServices"
             applicationName="SampleApplication"
             description="SqlProfileProvider for SampleApplication" />
      </providers>

      <properties>
        <add name="ZipCode" />
        <add name="CityAndState" />
      </properties>
    </profile>
  </system.web>
</configuration>

요소 정보

구성 섹션 처리기

System.Web.Configuration.ProfileSection

구성 멤버

SystemWebSectionGroup.Profile

구성 가능한 위치

Machine.config

루트 수준의 Web.config

응용 프로그램 수준의 Web.config

요구 사항

Microsoft IIS(인터넷 정보 서비스) 버전 5.0, 5.1 또는 6.0

.NET Framework 버전 2.0

Microsoft Visual Studio 2005

참고 항목

작업

How to: Lock ASP.NET Configuration Settings

참조

system.web 요소(ASP.NET 설정 스키마)

<configuration> 요소

profile 요소에 대한 properties 요소(ASP.NET 설정 스키마)

profile 요소에 대한 providers 요소(ASP.NET 설정 스키마)

ProfileSection

System.Configuration

System.Web.Configuration

개념

ASP.NET Profile Properties Overview

ASP.NET Configuration Overview

ASP.NET Server Controls and Browser Capabilities

Securing Configuration

Configuration Inheritance

기타 리소스

ASP.NET Configuration Files

ASP.NET 구성 설정

일반 구성 설정(ASP.NET)

ASP.NET Configuration API