Sorry this is my first question, don't know ho this works and i'm quite new to ASP.NET MVC. My action is:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult SearchResults(PersonSearch search, int? page)
{
// Assign the search results to the View
ViewData["Results"] = new PaginatedList<Person>(
_searchService.FindPersons(personSearch), page ?? 0, 1);
// Display the View and assign to it its Model (PersonSearch instance)
return View("SearchResults", personSearch);
}
Quite simple, the Model of SearchResults.aspx is an instance of PersonSearch; when the request for a new page arrive (a GET request), the action method should take it and compute the new results. Then i have to generate the previous/next links:
<%= Html.ActionLink("Next Page >", "SearchResults", routeValues) %>
If i use routeValues = ViewData.Model i can see the object properties passed correctly throw the address, but i can't add the "page" parameter.
How to? Many Thanks