Results.RedirectToRoute Method

Definition

Overloads

RedirectToRoute(String, RouteValueDictionary, Boolean, Boolean, String)

Redirects to the specified route.

RedirectToRoute(String, Object, Boolean, Boolean, String)

Redirects to the specified route.

RedirectToRoute(String, RouteValueDictionary, Boolean, Boolean, String)

Redirects to the specified route.

public static Microsoft.AspNetCore.Http.IResult RedirectToRoute (string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? routeValues, bool permanent = false, bool preserveMethod = false, string? fragment = default);
static member RedirectToRoute : string * Microsoft.AspNetCore.Routing.RouteValueDictionary * bool * bool * string -> Microsoft.AspNetCore.Http.IResult
Public Shared Function RedirectToRoute (routeName As String, routeValues As RouteValueDictionary, 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
RouteValueDictionary

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

The created IResult for the response.

Applies to

RedirectToRoute(String, Object, Boolean, Boolean, String)

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

The created IResult for the response.

Applies to