Preserve data in .net mvc
- by Wei Ma
I am implementing a search module with result page support paging.
The example provided by NerdDinner passes pagenumber as a parameter for the Index action, and the action uses the pagenumber to perform a query each time the user hit a different page number.
My problem is that my search take many more criteria such as price, material, model number etc. than just simple pagenumber. Therefore, I would like to preserve the criteria after users' first submission, so that I only have to pass the pagenumber back and forth.
Using ViewData is not possible because ViewData get cleared once it is sent to the View.
Is there any good way to preserve the criteria data as I wish?