- Url路由分页
- Ajax分页
- Ajax搜索分页
- 外观样式
- 分页数据相关
- Javascrip API
- AjaxPager 类
- AjaxHelper.Pager 扩展方法
- HtmlPager 类
- HtmlHelper.Pager 扩展方法
- IPagedList 接口
- IPagedList<T> 接口
- MvcAjaxOptions 类
- MvcAjaxOptionsBuilder 类
- PagedList<T> 类
- PageLinqExtensions 类
-
PagerOptions 类
- ActionName属性
- AlwaysShowFirstLastPageNumber属性
- AutoHide属性
- ContainerTagName属性
- ControllerName属性
- CssClass属性
- CurrentPageNumberFormatString属性
- CurrentPagerItemTemplate属性
- DisabledPagerItemTemplate属性
- FirstPageRouteName属性
- FirstPageText属性
- GoToButtonId属性
- HidePagerItems属性
- HorizontalAlign属性
- HtmlAttributes属性
- Id属性
- InvalidPageIndexErrorMessage属性
- LastPageText属性
- MaximumPageIndexItems属性
- MaximumPageNumber属性
- MorePagerItemTemplate属性
- MorePageText属性
- NavigationPagerItemsPosition属性
- NavigationPagerItemTemplate属性
- NextPageText属性
- NumericPagerItemCount属性
- NumericPagerItemTemplate属性
- OnPageIndexError属性
- PageIndexBoxId属性
- PageIndexOutOfRangeErrorMessage属性
- PageIndexParameterName属性
- PageNumberFormatString属性
- PagerItemTemplate属性
- PrevPageText属性
- RouteName属性
- RouteValues属性
- ShowDisabledPagerItems属性
- ShowFirstLast属性
- ShowMorePagerItems属性
- ShowNumericPagerItems属性
- ShowPrevNext属性
- PagerItemsPosition 枚举
- PagerOptionsBuilder 类
- ScriptResourceExtensions 类
- Javascript API
- AjaxPager.cs
- AjaxPagerTest.cs
- DataLoaderBuilder.cs
- DisplayNameExtensions.cs
- HtmlPager.cs
- HtmlPagerTest.cs
- IPagedList.cs
- MvcAjaxOptions.cs
- MvcAjaxOptionsBuilder.cs
- MvcPager.js
- PagedList.cs
- PagedListTest.cs
- PageLinqExtensions.cs
- PagerBuilder.cs
- PagerExtensions.cs
- PagerItem.cs
- PagerItemsPosition.cs
- PagerOptions.cs
- PagerOptionsBuilder.cs
- ScriptResourceExtensions.cs
- TestHelper.cs
MvcPager 分页示例 — 导航按钮位置
该示例演示如何设置MvcPager的导航按钮(上页、下页、首页和尾页)的位置。
默认(NavigationPagerItemsPosition = PagerItemsPosition.BothSide):
左侧(NavigationPagerItemsPosition = PagerItemsPosition.Left):
右侧(NavigationPagerItemsPosition = PagerItemsPosition.Right):
View:
@model PagedList<string> <h6><strong>默认(NavigationPagerItemsPosition = PagerItemsPosition.BothSide):</strong></h6> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ContainerTagName = "ul", CssClass = "pagination", CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>", DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>", PagerItemTemplate = "<li>{0}</li>", Id = "pager1" }) <h6><strong>左侧(NavigationPagerItemsPosition = PagerItemsPosition.Left):</strong></h6> <div class="row" style="height:80px"> <div class="col-md-8"> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id",NumericPagerItemCount = 5, ContainerTagName = "ul", CssClass = "pagination", CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>", DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>", PagerItemTemplate = "<li>{0}</li>", Id = "pager2", PageIndexBoxId = "pageIndexBox", GoToButtonId = "goToBtn",NavigationPagerItemsPosition = PagerItemsPosition.Left}) </div> <div class="col-md-4"> <div class="input-group" style="width:120px;margin:20px 0"> <select id="pageIndexBox" class="form-control input-sm"></select> <span class="input-group-btn"><button class="btn btn-primary btn-sm" id="goToBtn">跳转</button></span> </div> </div> </div> <h6><strong>右侧(NavigationPagerItemsPosition = PagerItemsPosition.Right):</strong></h6> <div class="row" style="height:80px"> <div class="col-md-8"> @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id",NumericPagerItemCount = 5,ContainerTagName = "ul", CssClass = "pagination", CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>", DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>", PagerItemTemplate = "<li>{0}</li>", Id = "pager3", PageIndexBoxId = "pageIndexBox2", GoToButtonId = "goToBtn2", NavigationPagerItemsPosition = PagerItemsPosition.Right }) </div> <div class="col-md-4"> <div class="input-group" style="width:120px;margin:20px 0"> <input type="text" id="pageIndexBox2" class="form-control input-sm" /> <span class="input-group-btn"><button class="btn btn-primary btn-sm" id="goToBtn2">跳转</button></span> </div> </div> </div> @section Scripts{@{Html.RegisterMvcPagerScriptResource();}}
Controller:
public ActionResult NavButtonsPosition(int id = 1) { return View(new PagedList<string>(new string[0], id, 1, 80)); }