HttpListenerResponse.RedirectLocation Property
.NET Framework 2.0
Note: This property is new in the .NET Framework version 2.0.
Gets or sets the value of the HTTP Location header in this response.
Namespace: System.Net
Assembly: System (in system.dll)
Assembly: System (in system.dll)
/** @property */ public String get_RedirectLocation () /** @property */ public void set_RedirectLocation (String value)
public function get RedirectLocation () : String public function set RedirectLocation (value : String)
Property Value
A String that contains the absolute URL to be sent to the client in the Location header.The Location header specifies the URL to which the client is directed to locate a requested resource.
Note |
|---|
| Setting this property does not automatically set the StatusCode property. |
The following code example demonstrates setting this property.
public static void TemporaryRedirect(HttpListenerRequest request, HttpListenerResponse response) { if (request.Url.OriginalString == @"http://www.contoso.com/index.html") { response.RedirectLocation = @"http://www.contoso.com/indexServer/index.html"; } }
Windows 98, Windows Server 2003, Windows XP Media Center Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Note