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

설명

이 지정한 오류는 현재 구성 오류 요소를 대체합니다.

적용 대상