C
C#2y ago
PatrickG

❔ Simple url parameter not working in blazor wasm???

I have a page with routes: @page "/Administration/Security/UserAccounts" @page "/Administration/Security/UserAccounts/{id?}" first route works but if I use NavigationManager.NavigateTo($"/Administration/Security/UserAccounts/1"); I get a message saying unable to cast parameter????? I set up my parameter as a long @code { [Parameter] public long? Id { get; set; } } i tried with an int too same thing I also tried @page "/Administration/Security/UserAccounts/{id}" without a question mark
3 Replies
NinjaOla
NinjaOla2y ago
ASP.NET Core Blazor routing and navigation
Learn how to manage request routing in Blazor apps and how to use the Navigation Manager and NavLink component for navigation.
PatrickG
PatrickGOP2y ago
oh yea {Id:long?} worked thx
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server