RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage Method

Definition

Overloads

MapFallbackToPage(IEndpointRouteBuilder, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a page endpoint that matches page.

MapFallbackToPage(IEndpointRouteBuilder, String, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a page endpoint that matches page.

MapFallbackToPage(IEndpointRouteBuilder, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a page endpoint that matches 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

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

page
String

The page name.

Returns

Remarks

MapFallbackToPage(IEndpointRouteBuilder, String) is intended to handle cases where URL path of the request does not contain a file name, and no other endpoint has matched. This is convenient for routing requests for dynamic content to a SPA framework, while also allowing requests for non-existent files to result in an HTTP 404.

MapFallbackToPage(IEndpointRouteBuilder, String) registers an endpoint using the pattern {*path:nonfile}. The order of the registered endpoint will be int.MaxValue.

MapFallbackToPage(IEndpointRouteBuilder, String) does not re-execute routing, and will not generate route values based on routes defined elsewhere. When using this overload, the path route value will be available.

MapFallbackToPage(IEndpointRouteBuilder, String, String)

Adds a specialized RouteEndpoint to the IEndpointRouteBuilder that will match requests for non-file-names with the lowest possible priority. The request will be routed to a page endpoint that matches 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

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

pattern
String

The route pattern.

page
String

The action name.

Returns

Remarks

MapFallbackToPage(IEndpointRouteBuilder, String, String) is intended to handle cases where URL path of the request does not contain a file name, and no other endpoint has matched. This is convenient for routing requests for dynamic content to a SPA framework, while also allowing requests for non-existent files to result in an HTTP 404.

The order of the registered endpoint will be int.MaxValue.

This overload will use the provided pattern verbatim. Use the :nonfile route contraint to exclude requests for static files.

MapFallbackToPage(IEndpointRouteBuilder, String, String) does not re-execute routing, and will not generate route values based on routes defined elsewhere. When using this overload, the route values provided by matching pattern will be available.

Applies to