HttpResponse.SuppressFormsAuthenticationRedirect 属性

定义

获取或设置指定重定向至登录页的 forms 身份验证是否应取消的值。

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 服务请求时。 此属性提供了一种禁止重定向行为并将原始状态代码发送到客户端的方法。

适用于