© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
malkav

Blazor routing with multiple parameters [Answered]

is there someone who can explain why my blazor page isn't taking 2 parameters in the route?
I've got this as route (example):
/user/{previous}/print/{userid}
/user/{previous}/print/{userid}

which resuls in one of two things (at the moment):
/user/profile/print/[userid]
/user/profile/print/[userid]
or
/user/admin-something/print/[userid]
/user/admin-something/print/[userid]

but only the first of the two seems to actually present the page I desire, the second one however, gives me the "Sorry, there's nothing at this address" screen....
What am I missing?

My page's Code section looks like this:
// @code {
[Parameter]public string previous {get;set;}
[Parameter] public string userid {get;set;}

// Other parameters here
private bool _isReady;
// ...

// Method section
private void SomeMethod()
{
  // ...
}

private void NavigateBack()
{
  NavManager.NavigateTo($"/{Previous.Replace("-", "/")}");
}
// @code {
[Parameter]public string previous {get;set;}
[Parameter] public string userid {get;set;}

// Other parameters here
private bool _isReady;
// ...

// Method section
private void SomeMethod()
{
  // ...
}

private void NavigateBack()
{
  NavManager.NavigateTo($"/{Previous.Replace("-", "/")}");
}


Top of the page:
@layout PrintingLayout
@page "/user/{previous}/print/{userid}"


@inject IJSRuntime Js // for calling print PDF functions
@inject NavigationManager NavManager
@layout PrintingLayout
@page "/user/{previous}/print/{userid}"


@inject IJSRuntime Js // for calling print PDF functions
@inject NavigationManager NavManager
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 Routing - multiple modules from assemblies in one app.
C#CC# / help
3y ago
❔ Blazor Client Side: Get Query-Parameters
C#CC# / help
3y ago