ResponseExtensions.Redirect(HttpResponse, String, Boolean, Boolean) Metoda

Definicja

Zwraca odpowiedź przekierowania (HTTP 301, HTTP 302, HTTP 307 lub HTTP 308) do klienta.

public:
[System::Runtime::CompilerServices::Extension]
 static void Redirect(Microsoft::AspNetCore::Http::HttpResponse ^ response, System::String ^ location, bool permanent, bool preserveMethod);
public static void Redirect (this Microsoft.AspNetCore.Http.HttpResponse response, string location, bool permanent, bool preserveMethod);
static member Redirect : Microsoft.AspNetCore.Http.HttpResponse * string * bool * bool -> unit
<Extension()>
Public Sub Redirect (response As HttpResponse, location As String, permanent As Boolean, preserveMethod As Boolean)

Parametry

response
HttpResponse

Element HttpResponse do przekierowania.

location
String

Adres URL umożliwiający przekierowanie klienta do. Musi to być poprawnie zakodowane do użycia w nagłówkach http, gdzie dozwolone są tylko znaki ASCII.

permanent
Boolean

True jeśli przekierowanie jest trwałe (301 lub 308), w przeciwnym razie false (302 lub 307).

preserveMethod
Boolean

True jeśli przekierowanie musi ponownie użyć metody i treści (308 lub 307), w przeciwnym razie false (301 lub 302).

Dotyczy