Share via


Results.RedirectToRoute 方法

定義

多載

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

重新導向至指定的路由。

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

重新導向至指定的路由。

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

重新導向至指定的路由。

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

參數

routeName
String

路由的名稱。

routeValues
RouteValueDictionary

路由的參數。

permanent
Boolean

指定重新導向應該是永久 (301) 還是暫時 (302) 。

preserveMethod
Boolean

如果設定為 true,請將暫時重新導向 (307) 或永久重新導向 (308) 保留初始要求方法。

fragment
String

要新增至 URL 的片段。

傳回

為回應建立 IResult 的 。

適用於

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

重新導向至指定的路由。

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

參數

routeName
String

路由的名稱。

routeValues
Object

路由的參數。

permanent
Boolean

指定重新導向應該是永久 (301) 還是暫時 (302) 。

preserveMethod
Boolean

如果設定為 true,請將暫時重新導向 (307) 或永久重新導向 (308) 保留初始要求方法。

fragment
String

要新增至 URL 的片段。

傳回

為回應建立 IResult 的 。

適用於