Home How do I get my WebGrid to POST instead of GET during a sort or paging operation in my MVC4 site?
Reply: 0

How do I get my WebGrid to POST instead of GET during a sort or paging operation in my MVC4 site?

user818
1#
user818 Published in May 21, 2018, 6:38 pm

I have a fairly simple site with a Search partial view and a Listing partial view. They're rolled up using multiple models into the Index view.

Everything is fine. Except when I click the grid column headers to sort or attempt to page to the next listing of data, the grid comes back empty. If I re-submit the same search criteria, then the grid repopulates with all applicable data sorted or paged properly.

I've tracked this behavior down to the fact that the WebGrid sets up it's paging and sorting mechanisms as a GET instead of a POST. So obviously all my model data is left off the submission.

Isn't there a way to get the WebGrid to POST so the data tags along? Seems quite counterproductive for the WebGrid as a class to not include the data one wants to page or sort.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310278 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO