共用方式為


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

屬性值

應用程式在錯誤發生時重新導向到的 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。

適用於