asp-all-route-data are being appended with asp-route-param #28333
Unanswered
thedangler
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to create links for my page but some of the links rely on what is previously in the querysting.
I get what is in the current querystring like so:
When using asp-all-route-data="@params" that seems to generate the link with the current querystring.
and when I do
<a asp-all-route-data="@params" asp-route-nextpage="2">
i get a new link with &nextpage=2.The issue is, doing this actually adds nextpage=2 to params so every link on my page now contains &nextpage=2.
Forexample down in my page I want to have links to change the return size so I'm doing
<a asp-all-route-data="@param" asp-route-size="10"> <a asp-all-route-data="@param" asp-route-size="20"> <a asp-all-route-data="@param" asp-route-size="50">
I'm getting a link of
href="..&nextpage=2&size=10" href="..&nextpage=2&size=20" href="..&nextpage=2&size=50"
I expected
href="..&size=10" href="..&size=20" href="..&size=50"
I didn't expect nextpage to be added to the params list.
How do I get around this issue?
I do not want to manually have to type out each asp-route-param because I'm getting all those in a loop from the querystring I they change all the time based on a gridview filters I want to maintain.
Is this a bug?
Beta Was this translation helpful? Give feedback.
All reactions