MVC三种分页方法
2021-01-29 21:16
标签:parameter tor param 分页 data options models ica page View部分: @using WebApplication1.Models;分页方法1引包 @*分页方法1*@ Controller部分: //第三方插件分页1:using Webdiyer.WebControls.Mvc; //第三方插件分页2:using PagedList; MVC三种分页方法 标签:parameter tor param 分页 data options models ica page 原文地址:https://www.cnblogs.com/ypyp123/p/13199473.html
@*@using PagedList.Mvc;
@using WebApplication1.Models;
@model PagedList.IPagedList
@Html.Pager(Model, new PagerOptions
{
Id = "htmlPager",
PageIndexParameterName = "pageIndex",
FirstPageText = "首页",
PrevPageText = "上一页",
NextPageText = "下一页",
LastPageText = "尾页",
CssClass = "pagination pagination-sm",
CurrentPagerItemTemplate = "
"{0}
DisabledPagerItemTemplate = "
PagerItemTemplate = "
})
@*分页方法2*@
@*@Html.PagedListPager(Model, page => Url.Action("UserList", new { page }))*@
public ActionResult UserList(int pageIndex = 1)
{
List
userListAll = userListAll.ToPagedList(pageIndex, 5);
return View(userListAll);
}
//public ActionResult UserList(int page = 1)
//{
// List
// return View(userListAll.ToPagedList(page, 5));
//}
//用户详情
public ActionResult DetailsUser(int id)
{
var users = education.t_users.Where
return View(users);
}
上一篇:CSS工程化