SuppressFormsAuthenticationRedirect Property

HttpResponse.SuppressFormsAuthenticationRedirect Property

.NET Framework 4.6 and 4.5

Gets or sets a value that specifies whether forms authentication redirection to the login page should be suppressed.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

public bool SuppressFormsAuthenticationRedirect { get; set; }

Property Value

Type: System.Boolean

true if forms authentication redirection should be suppressed; otherwise, false.

By default, forms authentication converts HTTP 401 status codes to 302 in order to redirect to the login page. 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.

.NET Framework
Available since 4.5
Return to top
© 2015 Microsoft