Preserve data in .net mvc

Posted by Wei Ma on Stack Overflow See other posts from Stack Overflow or by Wei Ma
Published on 2009-09-15T03:39:09Z Indexed on 2010/05/08 18:58 UTC
Read the original article Hit count: 300

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about asp.net-mvc