Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortableHeaderFor to include additional query string parameters #34

Open
junnavarra opened this issue Nov 15, 2019 · 1 comment
Open

Comments

@junnavarra
Copy link

Hi,

I have several query string parameters in my Index controller such as filter, pageindex, sortExpression and groupName. The SortableHeaderFor used for sorting generates a link which contains only the sortExpression parameter, for example, the razor code @Html.SortableHeaderFor(model => model.ItemDesc) generates the url http://localhost:60755/InventoryManagement/Index?sortExpression=-ItemDesc

I want to include the groupName that contains a value that I need to retain during sorting and will be passed also as parameter together with the sortExpression in the query string which will result to, something like this:

http://localhost:60755/InventoryManagement/Index?sortExpression=-ItemDesc&groupName=Supplies

Would it be possible?

Thank you for your guidance.

@m0ddixx
Copy link

m0ddixx commented Mar 15, 2022

You have to add them into the PagingList.RouteValues dictionary. The keys are the parameter names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants