This code will help you to understand how to handle the parameter in routing in Blazor
The parameters can be defined using curly braces within a routing template in both the @page directive and RouteAttribute.
Using @page directive
@page "/Route" @page "/Route/{id}" <h3>Routing Id: @Id</h3> @code { [Parameter] public string Id { get; set; } }
Using RouteAttribue
[Route("/Route/{id}")] public class BaseComponent: ComponentBase { public string Id { get; set; } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
The parameters can be defined using curly braces within a routing template in both the @page directive and RouteAttribute.
Using @page directive
Using RouteAttribue
need an explanation for this answer? contact us directly to get an explanation for this answer