MvcPager for ASP.NET Core Mvc 2.X & 3.X
- nuget:Install-Package HeyCoder.AspNetCore.MvcPager
- CLI:dotnet add package HeyCoder.AspNetCore.MvcPager
- https://www.nuget.org/packages/HeyCoder.AspNetCore.MvcPager
- Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IPagerOption, PagerOption>();
}
- appsettings.json
{
"HeyCoder.MvcPager": {
"PageSize": "10",
"PageButtonCount": "10",
"PagerClassName": "pager",
"CurrentPageClassName": "active",
"PrePageButtonText": "<",
"NextPageButtonText": ">",
"PreGroupButtonText": "<<",
"NextGroupButtonText": ">>",
"FirstPageButtonText": "首页",
"LastPageButtonText": "尾页",
"ShowPagerStatus": "true",
"ShowPreNextPageButton": "true",
"ShowFirstLastPageButton": "false",
"ShowGotoPanel": "true",
"ShowDataCount": "true",
"CurrentPageInCenter": "true",
"DataCountTextFormat": "共{0}条数据",
"PagerStatusTextFormat": "共{1}页"
}
}
wiki:https://github.com/heycoder/mvcpager.core/wiki
- Theme:Default
<link href="//cdn.ken.io/plugin/mvcpager/theme/default-1.0.css" rel="stylesheet"/>
@Html.Pager(new {p = Guid.NewGuid().ToString()}, new PagerOption(){ PageIndex = Model.PageIndex })
- Theme:BootStrap
<link href="//cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="//cdn.ken.io/plugin/mvcpager/theme/bootstrap-1.0.css" rel="stylesheet" />
@Html.Pager(new {p = Guid.NewGuid().ToString()}, new PagerOption(){ PageIndex = Model.PageIndex })
- 邮箱(Email):m#ken.io
- 博客(Blog):https://ken.io