Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
RedirectLocation Property

HttpResponse.RedirectLocation Property

Gets or sets the value of the HTTP Location header.

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

public string RedirectLocation { get; set; }

Property Value

Type: System.String
The absolute URI that is transmitted to the client in the HTTP Location header.


The HTTP headers have already been written.

The following example shows how to use this property to specify the redirect URL when you code a permanent redirect by using the HTTP 301 response code.

Response.StatusCode = 301;
Response.Status = "301 Moved Permanently";
Response.RedirectLocation = "http://www.newurl.com ";

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
© 2015 Microsoft