© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Blazor wasm not loading in github pages
C#CC# / help
3y ago
✅ Blazor WASM Headers
C#CC# / help
4mo ago
Blazor wasm help
C#CC# / help
6mo ago
Blazor WASM Authentication
C#CC# / help
2y ago