Reputation: 37366
Is there a way to show the page number links with the Pager helper? I would like the user to click a link and go to a specific page number, not having to go page through page.
Upvotes: 0
Views: 610
Reputation: 655
Needs Work but this should get you started
@using MvcContrib.UI.Pager
@using MvcContrib.Pagination
@model IPagination
@{
int linkCount = 1;
for (int i = 0; i < Model.TotalPages && linkCount<=10; i++)
{
linkCount++;
<a href="@ViewContext.Controller.ValueProvider.GetValue("controller").RawValue?Page=@(i + 1)">@(i + 1) </a>
}
}
Upvotes: 1
Reputation: 1038850
No, that's not supported by the MVCContrib pager out of the box. You will need to build a custom pager to support this.
Upvotes: 1