HttpResponse.RedirectLocation Propriedade

Definição

Obtém ou define o valor do cabeçalho 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

Valor de Propriedade

O URI absoluto que é transmitido ao cliente no cabeçalho HTTP Location .

Exceções

Os cabeçalhos HTTP já foram escritos.

Exemplos

O exemplo seguinte mostra como usar esta propriedade para especificar o URL de redirecionamento quando se codifica um redirecionamento permanente usando o código de resposta HTTP 301.

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

Aplica-se a