CustomError.Redirect Property

 

Gets or sets the redirection URL.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

<ConfigurationPropertyAttribute("redirect", IsRequired := True)>
<StringValidatorAttribute(MinLength := 1)>
Public Property Redirect As String

Property Value

Type: System.String

The URL to which the application is redirected when an error occurs.

The Redirect property identifies the URL of the custom page associated with a specific error.

The following code example shows how to use the redirection URL. Refer to the code example in the CustomError class topic to learn how to get the collection.

' Get first errorr Redirect.
  Dim currentError0 As CustomError = _
  customErrorsCollection(0)
  Dim currentRedirect As String = _
  currentError0.Redirect

' Set first error Redirect.
currentError0.Redirect = "customError404.htm"

.NET Framework
Available since 2.0
Return to top
Show: