CustomErrorsSection 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
ASP.NET 사용자 지정 오류를 구성합니다. 이 클래스는 상속될 수 없습니다.
public ref class CustomErrorsSection sealed : System::Configuration::ConfigurationSection
public sealed class CustomErrorsSection : System.Configuration.ConfigurationSection
type CustomErrorsSection = class
inherit ConfigurationSection
Public NotInheritable Class CustomErrorsSection
Inherits ConfigurationSection
- 상속
예제
이 예제에서는 클래스의 CustomErrorsSection 멤버로 액세스할 수도 있는 customErrors 섹션의 여러 특성에 대해 선언적으로 값을 지정하는 방법을 보여 줍니다.
다음 구성 파일 예제에서는 값을 선언적으로 지정 하는 방법을 보여 줍니다는 customErrors
섹션입니다.
<customErrors mode="RemoteOnly"
defaultRedirect="customerror.htm">
<error statusCode="404" redirect="customerror404.htm"/>
</customErrors>
다음 예제에서는 CustomErrorsSection 클래스를 사용하는 방법을 보여 줍니다.
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
// Get the section.
CustomErrorsSection customErrorsSection =
(CustomErrorsSection)configuration.GetSection(
"system.web/customErrors");
// Get the collection
CustomErrorCollection customErrorsCollection =
customErrorsSection.Errors;
' Get the Web application configuration.
Dim configuration _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim customErrorsSection _
As CustomErrorsSection = _
CType(configuration.GetSection( _
"system.web/customErrors"), _
CustomErrorsSection)
' Get the collection
Dim customErrorsCollection _
As CustomErrorCollection = customErrorsSection.Errors
설명
CustomErrorsSection 클래스를 사용하면 구성 파일의 customErrors
섹션을 프로그래밍 방식으로 액세스하고 수정할 수 있습니다. 이 형식은 포함 하는 그룹의 일부인 합니다 CustomErrorCollection, CustomErrorsMode, 및 CustomError 형식입니다.
참고
합니다 CustomErrorsSection 읽고에서 섹션 속성에 따라 구성 파일의 관련 섹션 정보를 쓸 수 있습니다 AllowDefinition 값인 Everywhere합니다.
생성자
CustomErrorsSection() |
기본 설정을 사용하여 CustomErrorsSection 클래스의 새 인스턴스를 초기화합니다. |
속성
AllowNestedErrors |
사용자 지정 오류 페이지를 표시할 수 없는 경우 ASP.NET에서 일반 오류 메시지를 표시해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다. |
CurrentConfiguration |
현재 Configuration 인스턴스가 속해 있는 구성 계층 구조를 나타내는 최상위 ConfigurationElement 인스턴스에 대한 참조를 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
DefaultRedirect |
기본 리디렉션 URL을 가져오거나 설정합니다. |
ElementInformation |
ElementInformation 개체의 사용자 지정할 수 없는 정보와 기능을 포함하는 ConfigurationElement 개체를 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
ElementProperty |
ConfigurationElementProperty 개체 자체를 나타내는 ConfigurationElement 개체를 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
Errors |
CustomError 개체의 컬렉션을 가져옵니다. |
EvaluationContext |
ContextInformation 개체의 ConfigurationElement 개체를 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
HasContext |
CurrentConfiguration 속성이 |
Item[ConfigurationProperty] |
이 구성 요소의 속성이나 특성을 가져오거나 설정합니다. (다음에서 상속됨 ConfigurationElement) |
Item[String] |
이 구성 요소의 속성, 특성 또는 자식 요소를 가져오거나 설정합니다. (다음에서 상속됨 ConfigurationElement) |
LockAllAttributesExcept |
잠긴 특성의 컬렉션을 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
LockAllElementsExcept |
잠긴 요소의 컬렉션을 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
LockAttributes |
잠긴 특성의 컬렉션을 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
LockElements |
잠긴 요소의 컬렉션을 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
LockItem |
요소가 잠겨 있는지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 ConfigurationElement) |
Mode |
오류 표시 형식을 가져오거나 설정합니다. |
Properties |
속성 컬렉션을 가져옵니다. (다음에서 상속됨 ConfigurationElement) |
RedirectMode |
사용자가 사용자 지정 오류 페이지로 리디렉션될 경우 요청의 URL을 변경해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다. |
SectionInformation |
사용자가 지정할 수 없는 SectionInformation 개체의 정보와 기능을 포함하는 ConfigurationSection 개체를 가져옵니다. (다음에서 상속됨 ConfigurationSection) |