HttpResponse.RedirectLocation Egenskap

Definition

Hämtar eller anger värdet för HTTP-huvudet Location .

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

Egenskapsvärde

Den absoluta URI som överförs till klienten i HTTP-huvudet Location .

Undantag

HTTP-huvudena har redan skrivits.

Exempel

I följande exempel visas hur du använder den här egenskapen för att ange omdirigerings-URL:en när du kodar en permanent omdirigering med hjälp av HTTP 301-svarskoden.

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

Gäller för