CustomError.Redirect 属性

定义

获取或设置重定向 URL。

public:
 property System::String ^ Redirect { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("redirect", IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string Redirect { get; set; }
[<System.Configuration.ConfigurationProperty("redirect", IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.Redirect : string with get, set
Public Property Redirect As String

属性值

String

应用程序在发生错误时重定向到的 URL。

属性

示例

下面的代码示例演示如何使用重定向 URL。 请参阅类主题中的 CustomError 代码示例,了解如何获取集合。

// Get first errorr Redirect.
CustomError currentError0 =
    customErrorsCollection[0];
string currentRedirect =
    currentError0.Redirect;

// Set first error Redirect.
currentError0.Redirect =
    "customError404.htm";
' Get first errorr Redirect.
  Dim currentError0 As CustomError = _
  customErrorsCollection(0)
  Dim currentRedirect As String = _
  currentError0.Redirect

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

注解

Redirect 属性标识与特定错误关联的自定义页面的 URL。

适用于