RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage 方法

定義

多載

MapFallbackToPage(IEndpointRouteBuilder, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序的非檔案名要求。 要求會路由傳送至符合 page 的頁面端點。

MapFallbackToPage(IEndpointRouteBuilder, String, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序的非檔案名要求。 要求會路由傳送至符合 page 的頁面端點。

MapFallbackToPage(IEndpointRouteBuilder, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序的非檔案名要求。 要求會路由傳送至符合 page 的頁面端點。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToPage(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ page);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToPage (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string page);
static member MapFallbackToPage : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToPage (endpoints As IEndpointRouteBuilder, page As String) As IEndpointConventionBuilder

參數

endpoints
IEndpointRouteBuilder

IEndpointRouteBuilder要加入路由的 。

page
String

頁面名稱。

傳回

備註

MapFallbackToPage(IEndpointRouteBuilder, String) 是要處理要求 URL 路徑不包含檔案名,且沒有其他端點相符的情況。 這方便將動態內容的要求路由傳送至 SPA 架構,同時允許要求不存在的檔案導致 HTTP 404。

MapFallbackToPage(IEndpointRouteBuilder, String) 使用 模式 {*path:nonfile} 註冊端點。 已註冊端點的順序會是 int.MaxValue

MapFallbackToPage(IEndpointRouteBuilder, String) 不會重新執行路由,而且不會根據其他地方定義的路由產生路由值。 使用此多載時, path 路由值將可供使用。

適用於

MapFallbackToPage(IEndpointRouteBuilder, String, String)

將特製化 RouteEndpoint 新增至 IEndpointRouteBuilder ,以符合具有最低可能優先順序的非檔案名要求。 要求會路由傳送至符合 page 的頁面端點。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapFallbackToPage(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, System::String ^ page);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapFallbackToPage (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, string page);
static member MapFallbackToPage : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapFallbackToPage (endpoints As IEndpointRouteBuilder, pattern As String, page As String) As IEndpointConventionBuilder

參數

endpoints
IEndpointRouteBuilder

IEndpointRouteBuilder要加入路由的 。

pattern
String

路由模式。

page
String

動作名稱。

傳回

備註

MapFallbackToPage(IEndpointRouteBuilder, String, String) 是要處理要求 URL 路徑不包含檔案名,且沒有其他端點相符的情況。 這方便將動態內容的要求路由傳送至 SPA 架構,同時允許要求不存在的檔案導致 HTTP 404。

已註冊端點的順序會是 int.MaxValue

此多載會使用所提供的 pattern 逐字。 :nonfile使用路由限制來排除靜態檔案的要求。

MapFallbackToPage(IEndpointRouteBuilder, String, String) 不會重新執行路由,而且不會根據其他地方定義的路由產生路由值。 使用此多載時,將會提供比對 pattern 所提供的路由值。

適用於