troygoode/PagedList — pull request #78 by NatanMakarov (2013-12-09 18:35:47+00:00)
Title: Append unobtrusive ajax url generator (attribute data-ajax-url)

Sometimes required to perform ajax queries to a different url address. It requires tag attribute "data-ajax-url".
I changed the helper methods for this feature (leaving backward compatibility):

Using helper method in view:
@Html.PagedListPager(
Model,
page => Url.Action("Index", new { page, size = Model.PageSize }),
page => Url.Action("Items", new { page, size = Model.PageSize }), // Unobtrusive ajax url generator
PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing("containerId")
);

Result markup:
<a href="/users/page-2" data-ajax-url="/users/items?page=2&size=25" data-ajax-...>2</a>