CustomErrorCollection.Set(CustomError) 메서드

정의

지정된 CustomError를 컬렉션에 추가합니다.

public:
 void Set(System::Web::Configuration::CustomError ^ customError);
public void Set (System.Web.Configuration.CustomError customError);
member this.Set : System.Web.Configuration.CustomError -> unit
Public Sub Set (customError As CustomError)

매개 변수

customError
CustomError

컬렉션에 추가할 CustomError입니다.

예제

다음 코드 예제에서는 지정 된 설정 하는 방법을 보여 줍니다 CustomError 개체입니다. 코드 예제에서는 참조는 CustomErrorCollection 클래스 항목 컬렉션을 가져오는 방법을 알아봅니다.

// Using the Set method.
CustomError newCustomError =
new CustomError(404, "customerror404.htm");

// Update the configuration file.
if (!customErrorsSection.SectionInformation.IsLocked)
{
    // Add the new custom error to the collection.
    customErrorsCollection.Set(newCustomError);
    configuration.Save();
}
' Using the Set method.
  Dim newCustomError _
  As New CustomError(404, "customerror404.htm")

' Update the configuration file.
If Not customErrorsSection.SectionInformation.IsLocked Then
   ' Add the new custom error to the collection.
   customErrorsCollection.Set(newCustomError)
   configuration.Save()
End If

설명

이 지정 된 오류는 현재 구성 오류 요소를 바꿉니다.

적용 대상