ryudice
ryudice

Reputation: 37366

Show page links in MVC Contrib pager

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

Answers (2)

Azure
Azure

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

Darin Dimitrov
Darin Dimitrov

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

Related Questions