Fork me on GitHub

PagerOptions.DisabledPagerItemTemplate property

Gets or sets the html template to be applied to the disabled pager items.

Remarks:

The first and the previous page buttons will be disabled if current page index is 1, the last and the next page buttons will be disabled if current page index is the last page index.

Syntax:

public string DisabledPagerItemTemplate {get; set;}

Default value:

null

Example:

@Html.Pager(Model,new PagerOptions{DisabledPagerItemTemplate="<span class=\"text-muted\"><strong>{0}</strong></span>"})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetDisabledPagerItemTemplate("<span class=\"text-muted\"><strong>{0}</strong></span>"))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.SetDisabledPagerItemTemplate("<span class=\"text-muted\"><strong>{0}</strong></span>")).AjaxOptions(a=>a.SetUpdateTargetId("target"))

Live demo:

@Html.Pager(Model, new PagerOptions { DisabledPagerItemTemplate = "<span class=\"text-muted\">{0}</span>" })
FirstPrev12345678910...NextLast

@Html.Pager(Model).Options(o => o.SetDisabledPagerItemTemplate("<span class=\"text-muted\"><strong>{0}</strong></span>"))
FirstPrev12345678910...NextLast