PageLinkGeneratorExtensions.GetPathByPage 方法

定義

多載

GetPathByPage(LinkGenerator, String, String, Object, PathString, FragmentString, LinkOptions)

根據提供的值產生具有絕對路徑的 URI。

GetPathByPage(LinkGenerator, HttpContext, String, String, Object, Nullable<PathString>, FragmentString, LinkOptions)

根據提供的值產生具有絕對路徑的 URI。

GetPathByPage(LinkGenerator, String, String, Object, PathString, FragmentString, LinkOptions)

來源:
PageLinkGeneratorExtensions.cs

根據提供的值產生具有絕對路徑的 URI。

public static string GetPathByPage (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string page, string handler = default, object values = default, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions options = default);
public static string? GetPathByPage (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string page, string? handler = default, object? values = default, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
static member GetPathByPage : Microsoft.AspNetCore.Routing.LinkGenerator * string * string * obj * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetPathByPage (generator As LinkGenerator, page As String, Optional handler As String = Nothing, Optional values As Object = Nothing, Optional pathBase As PathString = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

參數

page
String

頁面名稱。 用來解析端點。

handler
String

頁面處理常式名稱。 用來解析端點。 選擇性。

values
Object

路徑值。 選擇性。 用來解析端點,並在路由範本中展開參數。

pathBase
PathString

選擇性 URI 路徑基底。 在產生的 URI 中前面加上路徑。

fragment
FragmentString

URI 片段。 選擇性。 附加至產生的 URI。

options
LinkOptions

選擇性 LinkOptions。 所提供物件的設定會覆寫具有相符名稱的 RouteOptions 設定。

傳回

具有絕對路徑的 URI,如果 null 無法建立 URI,則為 。

適用於

GetPathByPage(LinkGenerator, HttpContext, String, String, Object, Nullable<PathString>, FragmentString, LinkOptions)

來源:
PageLinkGeneratorExtensions.cs

根據提供的值產生具有絕對路徑的 URI。

public static string GetPathByPage (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string page = default, string handler = default, object values = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions options = default);
public static string? GetPathByPage (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string? page = default, string? handler = default, object? values = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
static member GetPathByPage : Microsoft.AspNetCore.Routing.LinkGenerator * Microsoft.AspNetCore.Http.HttpContext * string * string * obj * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetPathByPage (generator As LinkGenerator, httpContext As HttpContext, Optional page As String = Nothing, Optional handler As String = Nothing, Optional values As Object = Nothing, Optional pathBase As Nullable(Of PathString) = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

參數

httpContext
HttpContext

HttpContext與目前要求相關聯的 。

page
String

頁面名稱。 用來解析端點。 選擇性。 如果 null 提供 ,則會使用目前的頁面路由值。

handler
String

頁面處理常式名稱。 用來解析端點。 選擇性。

values
Object

路徑值。 選擇性。 用來解析端點,並在路由範本中展開參數。

pathBase
Nullable<PathString>

選擇性 URI 路徑基底。 在產生的 URI 中前面加上路徑。 如果未提供,則會使用 的值 PathBase

fragment
FragmentString

URI 片段。 選擇性。 附加至產生的 URI。

options
LinkOptions

選擇性 LinkOptions。 所提供物件的設定會覆寫具有相符名稱的 RouteOptions 設定。

傳回

具有絕對路徑的 URI,如果 null 無法建立 URI,則為 。

適用於