sonnemaf / ReflectionIT.Mvc.Paging

ASP.NET Core 3.0 Paging (including filtering and sorting) solution using Entity Framework Core 3.0 and IEnumerable<T>
MIT License
79 stars 37 forks source link

Html.SortableHeaderFor link pointing to other page #17

Closed saifalmaluk closed 4 years ago

saifalmaluk commented 6 years ago

We have created mvc page List.cshtml

A table with clickable header is like below,

@Html.SortableHeaderFor(model => model.Title, this.Model)

The issue is when we click on header, it redirecting to index.cshtml page instead of list.cshtml.

Moxh3 commented 4 years ago

Same issue here, I'm routing to a specific page (non-index), but SortableHeaderFor provides links to the index...

Moxh3 commented 4 years ago

Fixed it myself. You can set the Action to route to: list.Action = "<PageName>";

where list is an instance of PagingList