C#C
C#4y ago
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}
which resuls in one of two things (at the moment): /user/profile/print/[userid] or /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("-", "/")}");
}


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


@inject IJSRuntime Js // for calling print PDF functions
@inject NavigationManager NavManager
Was this page helpful?