CustomErrorCollection.Get Metoda

Definicja

Pobiera określony CustomErrorelement .

Przeciążenia

Get(String)

CustomError Pobiera obiekt z określonym kodem stanu.

Get(Int32)

CustomError Pobiera obiekt z określonym indeksem.

Get(String)

CustomError Pobiera obiekt z określonym kodem stanu.

public:
 System::Web::Configuration::CustomError ^ Get(System::String ^ statusCode);
public System.Web.Configuration.CustomError Get (string statusCode);
member this.Get : string -> System.Web.Configuration.CustomError
Public Function Get (statusCode As String) As CustomError

Parametry

statusCode
String

Kod stanu HTTP skojarzony z błędem niestandardowym.

Zwraca

CustomError

CustomError Obiekt o określonym kodzie stanu.

Przykłady

Poniższy przykład kodu pokazuje, jak uzyskać CustomError obiekt z określonym kodem stanu.

Zapoznaj się z przykładem kodu w temacie klasy, CustomErrorCollection aby dowiedzieć się, jak pobrać kolekcję.

// Get the error with status code 404.
CustomError customError1 = 
    customErrorsCollection["404"];
' Get the error with status code 404.
  Dim customError1 As CustomError = _
  customErrorsCollection("404")

Dotyczy

Get(Int32)

CustomError Pobiera obiekt z określonym indeksem.

public:
 System::Web::Configuration::CustomError ^ Get(int index);
public System.Web.Configuration.CustomError Get (int index);
member this.Get : int -> System.Web.Configuration.CustomError
Public Function Get (index As Integer) As CustomError

Parametry

index
Int32

Indeks kolekcji CustomError obiektu.

Zwraca

CustomError

Element CustomError z określonym indeksem.

Przykłady

Poniższy przykład kodu pokazuje, jak uzyskać CustomError obiekt w określonym indeksie kolekcji.

Zapoznaj się z przykładem kodu w temacie klasy, CustomErrorCollection aby dowiedzieć się, jak pobrać kolekcję.

// Get the error with collection index 0.
CustomError customError = 
    customErrorsCollection[0];
' Get the error with collection index 0.
  Dim customError As CustomError = _
  customErrorsCollection(0)

Dotyczy