Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4845

Blazor Routing Parameters not working from blazor tutorial

$
0
0

Can someone show me what If anything I am doing wrong. When trying to get the routing to work from the tutorial I am doing. I feel like I followed everything word for word but I keep getting an error

@page "/counter/{initialCount:int?}"@rendermode InteractiveServer<PageTitle>Counter</PageTitle><h1>Counter</h1><p role="status">Current count: @currentCount</p><button class="btn btn-primary" @onclick="IncrementCount">Click me</button><p>InitialCount = @InitialCount</p>@code {    private int currentCount = 0;    [Parameter]    public int InitialCount { get; set; } = 0;    private void IncrementCount()    {        currentCount++;    }}

Viewing all articles
Browse latest Browse all 4845

Trending Articles