How would I go about adding a query string to the Razor Helper PagedListPager below ?
@Html.PagedListPager( (IPagedList)Model.PartsList, page => Url.Action("Index", new { page }) )
How would I go about adding a query string to the Razor Helper PagedListPager below ?
@Html.PagedListPager( (IPagedList)Model.PartsList, page => Url.Action("Index", new { page }) )
You don't add query parameters in
PagedListPager
, you do them inUrl.Action
.Below is an updated version of your code, I've added a query parameter
tag
.The URL would generate the following query string
Here is the same
Url.Action
withinPagedListPager
:You simply add more query parameters
The URL would generate the following query string
If a value is null the query string is not included in generated URL
Many thanks to Yorro!