数值页索引超链接按钮文本格式化字符串可以通过PagerOptions的PageNumberFormatString来设置,当前页数值按钮文本格式化字符串可以通过PagerOptions的CurrentPageNumberFormatString来设置。
请注意,格式化字符串值不应包含html代码,若出现html内容将会被编码显示。
数值页索引超链接按钮文本格式化字符串可以通过PagerOptions的PageNumberFormatString来设置,当前页数值按钮文本格式化字符串可以通过PagerOptions的CurrentPageNumberFormatString来设置。
PageNumberFormatString = "[{0}]"
PageNumberFormatString = "[{0}]", CurrentPageNumberFormatString = "{0}"
PageNumberFormatString = "-{0}-"
PageNumberFormatString = "-{0}-", CurrentPageNumberFormatString = "{0}"
@model PagedList<string> <h6>PageNumberFormatString = "[{0}]":</h6> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", PageNumberFormatString = "[{0}]" }) <hr /> <h6>PageNumberFormatString = "[{0}]", CurrentPageNumberFormatString = "{0}":</h6> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", PageNumberFormatString = "[{0}]", CurrentPageNumberFormatString = "{0}" }) <hr /> <h6>PageNumberFormatString = "-{0}-":</h6> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", PageNumberFormatString = "-{0}-" }) <hr /> <h6>PageNumberFormatString = "-{0}-", CurrentPageNumberFormatString = "{0}":</h6> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", PageNumberFormatString = "-{0}-", CurrentPageNumberFormatString = "{0}" })
public ActionResult NumericPagerItemsFormat(int id = 1) { return View(new PagedList<string>(new string[0], id, 1, 80)); }