RouteCollectionBuilder<TBuilder, TRouteType>.MapRoute(Action<ControlRouteBuilder<TRouteType>>) Method

Defines the request routing logic by specifying the request type along with the names of a Controller and an Action, which should handle it.

Namespace: DevExpress.AspNetCore.Bootstrap

Assembly: DevExpress.AspNetCore.Bootstrap.v18.2.dll


public TBuilder MapRoute(
    Action<ControlRouteBuilder<TRouteType>> config
Public Function MapRoute(
    config As Action(Of ControlRouteBuilder(Of TRouteType))
) As TBuilder


Type Name Description
Action<ControlRouteBuilder<TRouteType>> config

An action performing the required configurations through a ControlRouteBuilder object.


Type Description

A reference to this instance after the operation is completed.

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:

  • RouteType - Specifies the type of the requests to handle. Skip this setting to specify the default route.
  • 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 various requests from the Grid View control:

    .Routes(routes => routes
        .MapRoute(r => r
        .MapRoute(r => r
        .MapRoute(r => r
        .MapRoute(r => r
See Also