How to pass multiple parameter values form URL to same Razor view in ASP.NET Core

Viewed 285

Here I try to update the URL from a tag by asp-route and get the value in same Razor view.

<a asp-route-id="1" asp-route-notification="Receive"></a>

Then I try to access the value in bottom of the page with,

@{var id = Context.Request.RouteValues["id"];
var notification = Context.Request.RouteValues["notification"];
}

But this was return only id value. I couldn't get the notification parameter value. I want to get both values in same Razor view. Thanks in Advance.

0 Answers
Related