Share via


RazorPagesEndpointRouteBuilderExtensions.MapFallbackToAreaPage Method

Definition

Overloads

MapFallbackToAreaPage(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, and area.

MapFallbackToAreaPage(IEndpointRouteBuilder, String, 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, and area.

MapFallbackToAreaPage(IEndpointRouteBuilder, String, String)

Source:
RazorPagesEndpointRouteBuilderExtensions.cs

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, and area.

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

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

page
String

The action name.

area
String

The area name.

Returns

Remarks

MapFallbackToAreaPage(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.

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

MapFallbackToAreaPage(IEndpointRouteBuilder, String, 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.

Applies to

MapFallbackToAreaPage(IEndpointRouteBuilder, String, String, String)

Source:
RazorPagesEndpointRouteBuilderExtensions.cs

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, and area.

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

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

pattern
String

The route pattern.

page
String

The action name.

area
String

The area name.

Returns

Remarks

MapFallbackToAreaPage(IEndpointRouteBuilder, String, 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.

MapFallbackToAreaPage(IEndpointRouteBuilder, String, 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