Hi @Jush Stone ,
You can't use asp-route-page
to pass parameters, it will conflict with asp-page
, resulting in failure to receive parameters.
Try changing the parameter name. For example:
In first page:
<a asp-page="/Privacy" asp-route-id="car" asp-route-pageNumber="1">Test</a>
In second page model:
public void OnGet(string id,int pageNumber){ }
In second page view:
@page "{id}"
Test Result:
And the url:
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Chen Li