liveBook · Manning

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.

How 2 Manning books explain it

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
Uses named route values to generate URLs and carry values extracted from incoming requests to endpoints.
How deep it goes
Explains route-value extraction, defaults, constraints, and named-link generation with worked examples; defers detailed model binding.
Examples
Uses a named product endpoint, a defaulted product route, and a Razor Pages search handler to illustrate route values.
What you can do after
Apply it via LinkGenerator to generate a path for a named endpoint using route data.

Read how ASP.NET Core in Action, 3e explains route data →

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 →

Also covered in

What to know first

Related concepts

Questions about route data

What is 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.

Which Manning books explain route data?

ASP.NET Core in Action, 3e and Pro ASP.NET Core 7, Tenth Edition.

What should I know before learning route data?

Manning books that teach route data usually introduce HTTP request first.

What is the difference between route data and form data?

Route data is a collection of named information associated with a route and made available for request handling, navigation, rendering, or URL generation. Form data is a collection of named values associated with form controls for submission or processing.

What is route data a kind of?

Route data is a kind of data. Data is recorded or represented information, observations, measurements, or values that can be stored, processed, communicated, or interpreted.

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.