I have the following action link in my view <a asp-controller="Messages" asp-action="Index">Connect</a>
I need to pass a query string parameter with custom name (asp-route-id is in this case unacceptable) through asp-all-route-data
is there a way how can I specify just the dictionary there, rather than creating new dictionary somewhere in the view and pass it to the attribute?
I have tried to do it following way, but without a luck.
<a asp-all-route-data="["user"[email protected]]" asp-controller="Messages" asp-action="Index">Connect</a>
You can specify the Dictionary inline if you want, like this:
<a asp-all-route-data="@(new Dictionary<string, string> { { "user", item.PetSitter.UserId } })" asp-controller="Messages" asp-action="Index">Connect</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With