Skip to content

Conversation

@NatanMakarov
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant