How to preserve form values when sorting with an ASP.NET MVC4 WebGrid

zainghani

New Member
I'm building a search page in MVC4 with a filter form and a webgrid helper to display the data. Filtering and sorting all works fine, with the exception that when I click a column to sort, it reloads the initial version of the page using the GET controller function with the sort parameters, losing the filter settings. I would really like it to resubmit the form to the POST controller function so that the filter form is used and repopulated. What's the best way for me to do this?
 
Back
Top