CustomErrorCollection.Remove(String) 메서드

정의

CustomError 컬렉션에서 개체를 제거합니다.

public:
 void Remove(System::String ^ statusCode);
public void Remove(string statusCode);
member this.Remove : string -> unit
Public Sub Remove (statusCode As String)

매개 변수

statusCode
String

사용자 지정 오류와 연결된 HTTP 상태 코드입니다.

예제

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

// Using the Remove method.
if (!customErrorsSection.SectionInformation.IsLocked)
{
    // Remove the error with statuscode 404.
    customErrorsCollection.Remove("404");
    configuration.Save();
}
' Using the Remove method.
If Not customErrorsSection.SectionInformation.IsLocked Then
   ' Remove the error with statuscode 404.
   customErrorsCollection.Remove("404")
   configuration.Save()
End If

설명

메서드는 Remove 현재 계층 수준에서 구성 파일의 섹션에 요소를 remove 삽입 customErrors 합니다. 이렇게 하면 계층 구조의 add 상위 수준에서 부모 구성 파일에 정의된 요소에 대한 참조가 제거됩니다.

메모

add 요소는 부모 구성 파일에서 삭제되지 않습니다. 요소는 remove 단지 비활성화합니다. 그러나 메서드는 Remove 실제로 현재 계층 수준에서 삭제합니다.

적용 대상