Results.RedirectToRoute(String, Object, Boolean, Boolean, String) Method

Definition

Redirects to the specified route.

public static Microsoft.AspNetCore.Http.IResult RedirectToRoute (string? routeName = default, object? routeValues = default, bool permanent = false, bool preserveMethod = false, string? fragment = default);
static member RedirectToRoute : string * obj * bool * bool * string -> Microsoft.AspNetCore.Http.IResult
Public Shared Function RedirectToRoute (Optional routeName As String = Nothing, Optional routeValues As Object = Nothing, Optional permanent As Boolean = false, Optional preserveMethod As Boolean = false, Optional fragment As String = Nothing) As IResult

Parameters

routeName
String

The name of the route.

routeValues
Object

The parameters for a route.

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.

fragment
String

The fragment to add to the URL.

Returns

IResult

The created IResult for the response.

Applies to