Fork me on GitHub

PagerOptions.NavigationPagerItemTemplate property

Gets or sets the html template to be applied to the first, previous, next and last page pager items.

Remarks:

If DisabledPagerItemTemplate property value is not set, this template will also be applied to disabled pager items.

Syntax:

public string NavigationPagerItemTemplate {get; set;}

Default value:

null

Example:

@Html.Pager(Model,new PagerOptions{NavigationPagerItemTemplate="<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.SetNavigationPagerItemTemplate("<span class=\"text-muted\"><strong>{0}</strong></span>"))

AjaxPager:

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

Live demo:

<style type="text/css">
    .navbtns {font-weight: bold;color: #aeaeae;}
    .navbtns a {color: red;}
</style>
@Html.Pager(Model).Options(o => o.SetNavigationPagerItemTemplate("<span class=\"navbtns\">{0}</span>"))
FirstPrev12345678910...NextLast