Share via


HttpResponse.SuppressFormsAuthenticationRedirect 屬性

定義

取得或設定值,指定是否應該抑制表單驗證重新導向至登入頁面。

public:
 property bool SuppressFormsAuthenticationRedirect { bool get(); void set(bool value); };
public bool SuppressFormsAuthenticationRedirect { get; set; }
member this.SuppressFormsAuthenticationRedirect : bool with get, set
Public Property SuppressFormsAuthenticationRedirect As Boolean

屬性值

Boolean

如果不應執行表單驗證重新導向,則為 true,否則為 false

備註

根據預設,表單驗證會將 HTTP 401 狀態碼轉換為 302,以便重新導向至登入頁面。 這不適用於特定類別的錯誤,例如驗證成功但授權失敗,或目前的要求是 AJAX 或 Web 服務要求時。 這個屬性提供隱藏重新導向行為的方式,並將原始狀態碼傳送給用戶端。

適用於