Route data
Route data is a collection of named information associated with a route and made available for request handling, navigation, rendering, or URL generation.
ASP.NET Core in Action, 3e
Route data is a collection of named values supplied to an endpoint route during URL generation.
- How it is used
- Supplies named values to URL generation so links can follow an endpoint’s route template instead of hardcoding its path.
- How deep it goes
- Works through anonymous-object route data and named-endpoint path generation; defers Razor Pages and MVC URL-generation methods.
- Examples
- Demonstrates a named product endpoint generating /product/big-widget and a default parameter giving /product/shoes the value name=all.
- What you can do after
- Apply it via LinkGenerator.GetPathByName to generate a path for a named minimal API endpoint without hardcoding the link.
Pro ASP.NET Core 7, Tenth Edition
RouteData is the ASP.NET Core request-context data containing values produced by routing for the matched URL, including values captured from URL segments.
- How it is used
- Uses route values to adapt view-component output and supply action arguments through model binding.
- How deep it goes
- Demonstrates named-value access, a component unit test, and binding precedence without detailing routing internals.
- Examples
- Shows category-link highlighting, a route-data unit test, conditional controller-request output, and competing URL id values.
- What you can do after
- Apply it via ASP.NET Core RouteData.Values to tailor a view component or predict which id value an action receives.
Read how Pro ASP.NET Core 7, Tenth Edition explains route data →
Related concepts
- route parameterproduced by · A route parameter is a named variable embedded in a URL path whose value is captured from a matching request to identify or select a resource or operation.
- model bindingused by · Model binding is the process of locating incoming data, converting it to appropriate types, and assigning it to application objects or handler parameters.
- view componentused by · A view component is a reusable presentation component that encapsulates application logic and renders a portion of a user interface or response.
- form datacontrasts with · Form data is a collection of named values associated with form controls for submission or processing.
- url generationuses · URL generation is the programmatic construction of resource or endpoint URLs from routing metadata and parameter values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

