PagesSection.EnableViewStateMac 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
페이지가 클라이언트에서 다시 게시될 때 ASP.NET 페이지의 보기 상태에서 MAC(메시지 인증 코드)를 실행할지 여부를 지정하는 값을 가져오거나 설정합니다.
public:
property bool EnableViewStateMac { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enableViewStateMac", DefaultValue=true)]
public bool EnableViewStateMac { get; set; }
[<System.Configuration.ConfigurationProperty("enableViewStateMac", DefaultValue=true)>]
member this.EnableViewStateMac : bool with get, set
Public Property EnableViewStateMac As Boolean
속성 값
trueASP.NET 페이지가 클라이언트에서 다시 게시될 때 페이지 보기 상태에서 MAC(메시지 인증 코드)을 실행해야 하는 경우 그렇지 않으면 . false 기본값은 true입니다.
- 특성
예제
다음 코드 예제에서는 속성을 사용 하는 방법을 보여 있습니다 EnableViewStateMac .
// Get the current EnableViewStateMac property value.
Console.WriteLine(
"Current EnableViewStateMac value: '{0}'",
pagesSection.EnableViewStateMac);
// Set the EnableViewStateMac property to true.
pagesSection.EnableViewStateMac = true;
' Get the current EnableViewStateMac property value.
Console.WriteLine( _
"Current EnableViewStateMac value: '{0}'", _
pagesSection.EnableViewStateMac)
' Set the EnableViewStateMac property to true.
pagesSection.EnableViewStateMac = True
설명
뷰 상태 MAC은 페이지가 브라우저로 전송될 때 페이지의 뷰 상태가 유지되는 숨겨진 변수의 암호화된 버전입니다. 이 속성을 설정 true하면 암호화된 뷰 상태가 확인되어 클라이언트에서 변조되지 않았는지 확인합니다.
중요합니다
애플리케이션 또는 페이지에서 보기 상태를 사용하지 않더라도 이 특성은 프로덕션 웹 사이트에서 설정 false 해서는 안 됩니다. 뷰 상태 MAC은 뷰 상태 외에도 다른 ASP.NET 함수의 보안을 보장하는 데 도움이 됩니다.