asp-all-route-data value should not be changed
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
When generating multiple links using shared dictionary as `asp-all-route-data` parameter value, the dictionary will be changed if there are some other `asp-route-*=` parameters.
this will cause unexpected link query string in the following anchors.
refer: https://github.com/dotnet/AspNetCore.Docs/discussions/28333
### Expected Behavior
parameter provied to `asp-all-route-data` should not be changed, as the purpose of `asp-all-route-data` is for share link query parameters.
### Steps To Reproduce
There are some links to change sorting, using `order`.
```
Recent updated
Most used
```
And there are other links for change pagging will have wrong `order` parameter.
Exprected `order` value is the value in curent url query string,
Actual `order` value will be the last `asp-route-order` value in previoues tags.
```
-
首页
-
上一页
-
@i
-
@Model.CurrPage
-
@i
-
下一页
-
末页
@for (int i = Model.CurrPage.GetBeginPageIndex(); i < Model.CurrPage; i++)
{
}
@for (int i = Model.CurrPage + 1; i < Model.CurrPage.GetEndPageIndex(Model.PageCount); i++)
{
}
@if (Model.HasMore)
{
}
```
### Exceptions (if any)
_No response_
### .NET Version
8
### Anything else?
all asp.net core versions.
Contributor guide
Assessment
This issue has not been assessed yet.