model-view-controllerpaginationquery-string

Persist querystring parameter on paging with Stephen's walther tip #44?


I'm using Stephen Walther's paging tip #44 (http://stephenwalther.com/blog/archive/2008/09/18/asp-net-mvc-tip-44-create-a-pager-html-helper.aspx) on my app and it's working just fine, however on pages where there are querystring values, the values got omitted/stripped out. For example, on the search page:

mysiteURL/Search?search=searchterm

where "search=searchterm" is the parameter, using his paging stuffs, I got this:

mysiteURL/Search?page=0

How can I implement his paging class and also persist the querystring values? I'm new to .NET/MVC stuffs so if you could take a look at his paging classes and help me out, that would be great :)

Thank you all.


Solution

  • I made some modification to the PageBuilder.cs class and got the querystring value to work now. In case you are having the same problem, take a look at this page:

    http://www.kennysax.com/Blog/30/persists_querystring_values_with_mvc_paging