Fork me on GitHub

MvcPager帮助文档 - PagerOptions.MorePagerItemTemplate属性

获取或设置更多页分页元素的html模板。

语法:

public string MorePagerItemTemplate {get; set;}

默认值:

null

用法示例:

@Html.Pager(Model,new PagerOptions{MorePagerItemTemplate="<span class=\"morepages\">{0}</span>"})

此属性也可通过MvcPager的Options扩展方法设置:

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetMorePagerItemTemplate("<span class=\"morepages\">{0}</span>"))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.SetMorePagerItemTemplate("<span class=\"morepages\">{0}</span>")).AjaxOptions(a=>a.SetUpdateTargetId("target"))

示例:

<style type="text/css">
.morepages {font-weight: bold;}
.morepages a {color: red;}
</style>
@Html.Pager(Model).Options(o => o.SetMorePagerItemTemplate("<span class=\"morepages\">{0}</span>"))
首页上页...9101112131415161718...下页尾页