Results.LocalRedirect(String, Boolean, Boolean) Method

Definition

Redirects to the specified localUrl.

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

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 IResult for the response.

Applies to