I am using the pager provided by Martijn Boland to implementing paging in my Asp.Net Mvc 2 application.
My form uses the GET method to send all parameters to the querystring, it is a search form with several form elements.
<% using (Html.BeginForm("SearchResults", "Search", FormMethod.Get))
{%>
On the SearchResults View I am trying to implement paging:
<div class="pager">
<%= Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount,
new { Request.QueryString })%>
</div>
The Html.Pager has some overloads which I am not too clear on how to use. The Request.QueryString makes the querystring look like this:
http://localhost:1155/Search/SearchResults?QueryString=Distance%3D10%26txtZip%3D%26cb&page=2
Should it not be like this?
http://localhost:1155/Search/SearchResults?Distance=20&txtZip=10021&page=2