Fork me on GitHub

PagerOptions.AlwaysShowFirstLastPageNumber property

Gets or sets a value indicating whether the first and the last numeric pager items should be displaye.

Syntax:

public bool AlwaysShowFirstLastPageNumber {get; set;}

Default value:

false

Example:

@Html.Pager(Model,new PagerOptions{AlwaysShowFirstLastPageNumber=true})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.AlwaysShowFirstLastPageNumber())

AjaxPager:

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

Live demo:

@Html.Pager(Model).Options(o=>o.AlwaysShowFirstLastPageNumber())
FirstPrev12345678910...80NextLast