Live Chat Icon For mobile
Live Chat Icon

How do you handle the parameter in routing in Blazor?

Platform: Blazor| Category: Routing

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 {
    public string Id { get; set; }

Using RouteAttribue

public class BaseComponent: ComponentBase
    public string Id { get; set; }

Reference link:

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.