CustomError.StatusCode 속성

정의

HTTP 오류 상태 코드를 가져오거나 설정합니다.

public:
 property int StatusCode { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("statusCode", IsKey=true, IsRequired=true)]
[System.Configuration.IntegerValidator(MaxValue=999, MinValue=100)]
public int StatusCode { get; set; }
[<System.Configuration.ConfigurationProperty("statusCode", IsKey=true, IsRequired=true)>]
[<System.Configuration.IntegerValidator(MaxValue=999, MinValue=100)>]
member this.StatusCode : int with get, set
Public Property StatusCode As Integer

속성 값

사용자 지정 오류 페이지로 리디렉션을 발생시키는 HTTP 오류 상태 코드입니다.

특성

예제

다음 코드 예제에서는 상태 코드를 사용하는 방법을 보여 줍니다. 컬렉션을 가져오는 방법을 알아보려면 클래스 항목의 CustomError 코드 예제를 참조하세요.

// Get second error StatusCode.
CustomError currentError1 =
    customErrorsCollection[1];
int currentStatusCode =
    currentError1.StatusCode;

// Set the second error StatusCode.
currentError1.StatusCode = 404;
' Get second error StatusCode.
  Dim currentError1 As CustomError = _
  customErrorsCollection(1)
  Dim currentStatusCode As Integer = _
  currentError1.StatusCode

' Set the second error StatusCode.
  currentError1.StatusCode = 404

설명

HTTP 상태 코드는 특정 오류가 발생할 때 애플리케이션을 오류 페이지로 리디렉션하기 위해 ASP.NET 인프라에서 사용됩니다.

메모

사용자 지정 오류는 ASP.NET 의해 처리된 엔터티로 인해 발생하는 경우에만 발생합니다. 그렇지 않으면 표준 오류가 발생합니다.

적용 대상