HttpResponse.SuppressFormsAuthenticationRedirect HttpResponse.SuppressFormsAuthenticationRedirect HttpResponse.SuppressFormsAuthenticationRedirect HttpResponse.SuppressFormsAuthenticationRedirect Property

定义

获取或设置指定重定向至登录页的 forms 身份验证是否应取消的值。Gets or sets a value that specifies whether forms authentication redirection to the login page should be suppressed.

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

属性值

如果 Forms 身份验证重定向应禁止显示,则为 true;否则为 falsetrue if forms authentication redirection should be suppressed; otherwise, false.

注解

默认情况下,forms 身份验证将 HTTP 401 状态代码转换为302,以便重定向到登录页。By default, forms authentication converts HTTP 401 status codes to 302 in order to redirect to the login page. 这并不适用于某些错误类,例如当身份验证成功但授权失败,或者当前请求是 AJAX 或 web 服务请求时。This isn't appropriate for certain classes of errors, such as when authentication succeeds but authorization fails, or when the current request is an AJAX or web service request. 此属性提供了一种方式来禁止重定向行为,并将原始状态代码发送到客户端。This property provides a way to suppress the redirect behavior and send the original status code to the client.

适用于