HttpResponse.RedirectLocation Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the value of the HTTP Location header.

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

Public Property RedirectLocation As String

Property Value

Type: System.String

The absolute URI that is transmitted to the client in the HTTP Location header.

Exception Condition

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 = " ";

.NET Framework
Available since 1.1
Return to top