แก้ไข

แชร์ผ่าน


CustomErrorCollection.Get Method

Definition

Gets the specified CustomError.

Overloads

Get(String)

Gets the CustomError object with the specified status code.

Get(Int32)

Gets the CustomError object with the specified index.

Get(String)

Gets the CustomError object with the specified status code.

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

Parameters

statusCode
String

The HTTP status code associated with the custom error.

Returns

The CustomError object with the specified status code.

Examples

The following code example shows how to get a CustomError object with the specified status code.

Refer to the code example in the CustomErrorCollection class topic to learn how to get the collection.

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

Applies to

Get(Int32)

Gets the CustomError object with the specified index.

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

Parameters

index
Int32

The collection index of the CustomError object.

Returns

The CustomError with the specified index.

Examples

The following code example shows how to get a CustomError object at the specified collection index.

Refer to the code example in the CustomErrorCollection class topic to learn how to get the collection.

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

Applies to