Fork me on GitHub

PagerOptions.MaximumPageNumber property

Gets or sets the maximum page number limitation, default value is 0, which means maximum page number is calculated from the data to be paged.

Syntax:

public int MaximumPageNumber {get; set;}

Default value:

0

Example:

@Html.Pager(Model,new PagerOptions{MaximumPageNumber=20})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetMaximumPageNumber(20))

AjaxPager:

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

Live demo:

@Html.Pager(Model, new PagerOptions {MaximumPageNumber = 12})
FirstPrev12345678910...NextLast

@Html.Pager(Model).Options(o => o.SetMaximumPageNumber(18))
FirstPrev12345678910...NextLast