RouteCollectionBuilder<TBuilder>.MapRoute(Action<ControlRouteBuilder>) Method
Defines the request routing logic by specifying the names of a Controller and an Action, which should handle requests.
Namespace: DevExpress.AspNetCore.Bootstrap
Assembly: DevExpress.AspNetCore.Bootstrap.v18.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
config | Action<ControlRouteBuilder> | An action performing the required configurations through a Action<ControlRouteBuilder> object. |
Returns
Type | Description |
---|---|
TBuilder | A reference to this instance after the operation is completed. |
Remarks
IMPORTANT
Bootstrap Controls for ASP.NET Core are in maintenance mode. We don’t add new controls or develop new functionality for this product line. Our recommendation is to use the ASP.NET Core Controls suite.
$1 Use the MapRoute method to associate requests of the specified type with the specific handling action on the controller side. To achieve this, you need to provide the following settings:
- Controller - Specifies the name of a controller, whose action should handle the request.
- Action - Specifies the name of a controller action to handle the request.
- RouteValues - Allows you to specify the route in a cusotom form (e.g., to pass aditional parameters to the handling action).
The code sample below shows how to specify routes to handle requests from the Upload Control:
@(Html.DevExpress()
.BootstrapUploadControl("upload")
.Routes(routes => routes
.MapRoute(r => r
.Action("ProcessUploadedFile")
.Controller("Home")))
...
)