Bahasa

HttpResponse.RedirectLocation Properti

Definisi

Mendapatkan atau mengatur nilai header HTTP 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

Nilai Properti

URI absolut yang ditransmisikan ke klien di header HTTP Location .

Pengecualian

Header HTTP telah ditulis.

Contoh

Contoh berikut menunjukkan cara menggunakan properti ini untuk menentukan URL pengalihan saat Anda membuat kode pengalihan permanen dengan menggunakan kode respons HTTP 301.

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

Berlaku untuk