CustomErrorsSection 클래스
사용자 지정 오류 메시지를 ASP.NET 구성합니다.
구문
class CustomErrorsSection : ConfigurationSectionWithCollection
메서드
다음 표에서는 클래스에 의해 노출되는 메서드를 나열합니다 CustomErrorsSection
.
속성 | 설명 |
---|---|
추가 | ConfigurationSectionWithCollection에서 상속됩니다. |
지우기 | ConfigurationSectionWithCollection 에서 상속됩니다. |
가져오기 | ConfigurationSectionWithCollection 에서 상속됩니다. |
GetAllowDefinition | ( ConfigurationSection에서 상속됩니다.) |
GetAllowLocation | ConfigurationSection 에서 상속됩니다. |
제거 | ConfigurationSectionWithCollection 에서 상속됩니다. |
RevertToParent | ConfigurationSection 에서 상속됩니다. |
SetAllowDefinition | ConfigurationSection 에서 상속됩니다. |
SetAllowLocation | ConfigurationSection 에서 상속됩니다. |
속성
다음 표에서는 클래스에 의해 노출되는 속성을 나열합니다 CustomErrorsSection
.
속성 | Description |
---|---|
CustomErrors |
ASP.NET 사용자 지정 오류를 지정하는 CustomError 값의 배열입니다. |
DefaultRedirect |
HTTP 오류 메시지 파일의 기본 경로 또는 오류 메시지의 URL을 포함하는 필수 없음 읽기/쓰기 string 값입니다. 이 값은 새로 만든 CustomError 개체의 속성에 의해 Redirect 상속됩니다. |
Location |
(에서 ConfigurationSection 상속됨) 키 속성입니다. |
Mode |
사용자 지정 또는 기본 오류 페이지가 로컬 또는 원격으로 표시되는지 여부를 지정하는 읽기/쓰기 sint32 열거형입니다. 가능한 값은 설명 섹션의 뒷부분에 나와 있습니다. |
Path |
(에서 ConfigurationSection 상속됨) 키 속성입니다. |
SectionInformation |
ConfigurationSection 에서 상속됩니다. |
를 서브클래싱합니다.
이 클래스에는 서브클래스가 없습니다.
설명
클래스에서 CustomErrorsSection
나타내는 사용자 지정 오류는 ASP.NET 관련되며 Web.config 파일의 섹션에 있습니다 <system.web>
. 이러한 각 오류는 CustomError 클래스의 instance 표시됩니다.
HttpErrorsSection 클래스로 표시되는 사용자 지정 오류는 IIS 7과 관련이 있으며 ApplicationHost.config 파일의 섹션에 <system.webServer>
있습니다. 이러한 각 오류는 HttpErrorElement 클래스의 instance 표시됩니다. IIS 7의 IIS와 ASP.NET 통합되어 이 이름을 변경해야 했습니다.
다음 표에서는 속성에 사용할 수 있는 값을 나열합니다 Mode
. 기본값은 0(RemoteOnly
)입니다.
값 | 키워드 | Description |
---|---|---|
0 | RemoteOnly |
기본 ASP.NET 오류 페이지가 로컬 사용자에게 표시됩니다. 정의된 경우 원격 사용자에게 사용자 지정 오류 페이지가 표시됩니다. 받은 오류에 대해 사용자 지정 오류 페이지가 정의되지 않은 경우 IIS 오류 페이지가 표시됩니다. |
1 | On |
로컬 및 원격 사용자 모두에 대해 사용자 정의 ASP.NET 사용자 지정 오류 페이지가 표시됩니다. |
2 | Off |
로컬 및 원격 사용자 모두에 대해 기본 ASP.NET 오류 페이지가 표시됩니다. |
예제
다음 예제에서는 속성을 "CustomError.htm"로 Mode
설정하고 속성을 On
로 설정합니다DefaultRedirect
.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the custom errors section for the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "CustomErrorsSection", oSection
' Set the default redirect page to CustomError.htm,
' and set the Mode property to On.
oSection.DefaultRedirect = "CustomError.htm"
oSection.Mode = 1
oSection.Put_
상속 계층 구조
ConfigurationSectionWithCollection
CustomErrorsSection
요구 사항
형식 | Description |
---|---|
클라이언트 | - Windows Vista의 IIS 7.0 - Windows 7의 IIS 7.5 - Windows 8의 IIS 8.0 - WINDOWS 10 IIS 10.0 |
서버 | - Windows Server 2008의 IIS 7.0 - Windows Server 2008 R2의 IIS 7.5 - Windows Server 2012의 IIS 8.0 - Windows Server 2012 R2의 IIS 8.5 - WINDOWS SERVER 2016 IIS 10.0 |
제품 | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF 파일 | WebAdministration.mof |
참고 항목
ConfigurationSectionWithCollection 클래스
CustomError 클래스
HttpErrorElement 클래스
HttpErrorsSection 클래스