Problem Paging with Post Action in ASP.NET MVC
- by Lukasz
I have a page that takes a number of parameters on a form and posts them to an action. It returns a number of search results that need to be paged through. My pager uses ActionLink;
<%= Html.ActionLink(i.ToString(), "Basic", new { page = (i - 1) })%>
The results comeback as expected but when I click on page two it goes to the default Action, not the one marked with post. The form values do no get submitted again and the results that are shown for page two are the default results not filters with the parameters.
I am not sure how to solve this problem? One way was to save the form values into the database on the post and reading them back on the default action but it seems overkill.
Thank You!