Adding a Route Parameter
Learn how to pass value in route as parameter in Razor components.
We'll cover the following
Components can have multiple @page
directives. We will add an @page
directive to the Counter
component that uses a parameter. We do this as follows:
- Return to Visual Studio.
- Open the
Pages\Counter.razor
file. - Add the following
@page
directive to the top of the file:
Get hands-on with 1400+ tech skills courses.