Home Razor pages action tag helper does not generate query parameter
Reply: 0

Razor pages action tag helper does not generate query parameter

Anestis Kivranoglou
1#
Anestis Kivranoglou Published in 2017-11-10 16:19:54Z

I am following this msdn example Add Column Sort Links to the Students Index Page

And exactly like the example am trying to add links to my current page with some additional query parameters.

While using (exactly as the msdn example)

<a asp-action="Index" asp-route-sort="foo">Link</a>

The query parameter is not generated. The link i get is the same as my current url.

https://localhost:44346/clients

If i add the controller also on the tag helper , everything works fine.

<a asp-controller="Clients" asp-action="Index" asp-route-sort="foo">Link</a>

And i get

https://localhost:44346/Clients?sort=foo
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302914 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO