TypedResults.LocalRedirect(String, Boolean, Boolean) Method

Definition

Redirects to the specified localUrl.

public static Microsoft.AspNetCore.Http.HttpResults.RedirectHttpResult LocalRedirect (string localUrl, bool permanent = false, bool preserveMethod = false);
static member LocalRedirect : string * bool * bool -> Microsoft.AspNetCore.Http.HttpResults.RedirectHttpResult
Public Shared Function LocalRedirect (localUrl As String, Optional permanent As Boolean = false, Optional preserveMethod As Boolean = false) As RedirectHttpResult

Parameters

localUrl
String

The local URL to redirect to.

permanent
Boolean

Specifies whether the redirect should be permanent (301) or temporary (302).

preserveMethod
Boolean

If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.

Returns

The created RedirectHttpResult for the response.

Applies to