HttpWebClientProtocol.AllowAutoRedirect Property

Gets or sets whether the client automatically follows server redirects.

Namespace: System.Web.Services.Protocols
Assembly: System.Web.Services (in

public bool AllowAutoRedirect { get; set; }
/** @property */
public boolean get_AllowAutoRedirect ()

/** @property */
public void set_AllowAutoRedirect (boolean value)

public function get AllowAutoRedirect () : boolean

public function set AllowAutoRedirect (value : boolean)

Not applicable.

Property Value

true to automatically redirect the client to follow server redirects; otherwise, false. The default is false.

Exception typeCondition


The AllowAutoRedirect property is false and the Web server attempts to redirect the request.

If a client sends authentication information, such as a user name and password, you do not want to enable the server to redirect, because this can compromise security.

A WebException is thrown if the AllowAutoRedirect property is false and the Web server attempts to redirect the request. The Response property contains an HttpWebResponse object, where both the StatusCode and Headers properties reflect details regarding the attempted redirect. The StatusCode property contains an HttpStatusCode equivalent to one of the HTTP redirect status codes (301, 302, and 307) and the Location header within the Headers collection points to the URI that the request attempted to be redirected to.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0