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 string Redirect { get; set; }

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.
CustomError currentError0 =
    customErrorsCollection[0];
string currentRedirect =
    currentError0.Redirect;

// Set first error Redirect.
currentError0.Redirect =
    "customError404.htm";

.NET Framework
Available since 2.0
Return to top
Show: