HttpResponse.RedirectLocation Eigenschap

Definitie

Hiermee haalt u de waarde van de HTTP-header Location op of stelt u deze in.

public:
 property System::String ^ RedirectLocation { System::String ^ get(); void set(System::String ^ value); };
public string RedirectLocation { get; set; }
member this.RedirectLocation : string with get, set
Public Property RedirectLocation As String

Waarde van eigenschap

De absolute URI die wordt verzonden naar de client in de HTTP-header Location .

Uitzonderingen

De HTTP-headers zijn al geschreven.

Voorbeelden

In het volgende voorbeeld ziet u hoe u deze eigenschap gebruikt om de omleidings-URL op te geven wanneer u een permanente omleiding codeeert met behulp van de HTTP 301-antwoordcode.

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

Van toepassing op