Fork me on GitHub

PagerOptions.NumericPagerItemCount property

Gets or sets the maximum number of the numeric pager items to be displayed.

Syntax:

public int NumericPagerItemCount {get; set;}

Default value:

10

Example:

@Html.Pager(Model,new PagerOptions{NumericPagerItemCount=5})

This property value can also be set via the Options method as bellow:

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetNumericPagerItemCount(5))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.SetNumericPagerItemCount(5)).AjaxOptions(a=>a.SetUpdateTargetId("target"))

Live demo:

@Html.Pager(Model, new PagerOptions {NumericPagerItemCount = 5})
FirstPrev12345...NextLast

@Html.Pager(Model).Options(o => o.SetNumericPagerItemCount(8))
FirstPrev12345678...NextLast