All Projects → WeihanLi → MvcSimplePager

WeihanLi / MvcSimplePager

Licence: MIT license
Simple,lightweight,easy to expand pager for asp.net mvc and asp.net core,针对asp.net mvc 和 asp.net core 设计的通用、扩展性良好的轻量级分页扩展

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to MvcSimplePager

X.pagedlist
Library for easily paging through any IEnumerable/IQueryable in ASP.NET/ASP.NET Core
Stars: ✭ 625 (+4707.69%)
Mutual labels:  mvc, pager, asp-net-core, asp-net-mvc
PersianDataAnnotations
PersianDataAnnotations is ASP.NET Core MVC & ASP.NET MVC Custom Localization DataAnnotations (Localized MVC Errors) for Persian(Farsi) language - فارسی سازی خطاهای اعتبارسنجی توکار ام.وی.سی. و کور.ام.وی.سی. برای نمایش اعتبار سنجی سمت کلاینت
Stars: ✭ 38 (+192.31%)
Mutual labels:  mvc, aspnetcore, asp-net-core, asp-net-mvc
Recaptcha.aspnetcore
Google reCAPTCHA v2/v3 for .NET Core 3.x
Stars: ✭ 122 (+838.46%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-mvc
AspNetCoreMvcAngular
ASP.NET Core MVC with angular in MVC View OpenID Connect Hybrid Flow
Stars: ✭ 54 (+315.38%)
Mutual labels:  mvc, aspnetcore, asp-net-core
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+261.54%)
Mutual labels:  mvc, aspnetcore, asp-net-core
Awesome-Nuget-Packages
📦 A collection of awesome and top .NET packages sorted by most popular needs.
Stars: ✭ 87 (+569.23%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-mvc
Csla
A home for your business logic in any .NET application.
Stars: ✭ 865 (+6553.85%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-mvc
DNZ.SEOChecker
SEO Checker and Recommander Plugin (like wordpress Yoast) for ASP.NET Core.
Stars: ✭ 18 (+38.46%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-mvc
DNZ.MvcComponents
A set of useful UI-Components (HtmlHelper) for ASP.NET Core MVC based-on Popular JavaScript Plugins (Experimental project).
Stars: ✭ 25 (+92.31%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-mvc
React Aspnet Boilerplate
A starting point for building isomorphic React applications with ASP.NET Core, leveraging existing techniques.
Stars: ✭ 285 (+2092.31%)
Mutual labels:  mvc, asp-net-core, asp-net-mvc
Dotnetpaging
Data paging with ASP.NET and ASP.NET Core
Stars: ✭ 70 (+438.46%)
Mutual labels:  pager, asp-net-core, asp-net-mvc
Aspnetcore
ASP.NET Core Extension Library
Stars: ✭ 152 (+1069.23%)
Mutual labels:  mvc, pager, asp-net-core
DNTCommon.Web.Core
DNTCommon.Web.Core provides common scenarios' solutions for ASP.NET Core 3.x applications.
Stars: ✭ 117 (+800%)
Mutual labels:  mvc, aspnetcore, asp-net-mvc
AspNetCore-ReCAPTCHAv3
reCAPTCHA v3 Usage in Asp.Net Core MVC
Stars: ✭ 17 (+30.77%)
Mutual labels:  mvc, aspnetcore, asp-net-core
Elmahcore
ELMAH for Net.Standard and Net.Core
Stars: ✭ 127 (+876.92%)
Mutual labels:  mvc, aspnetcore, asp-net-core
Aspnetcorelocalization
Localization.SqlLocalizer & ASP.NET Core MVC Localization Examples
Stars: ✭ 183 (+1307.69%)
Mutual labels:  mvc, aspnetcore, asp-net-core
MsCoreOne
MsCoreOne is a simple Ecommerce with using many technologies such as .NET 5, Entity Framework Core 5, React 16.13 with modern Clean Architecture, Domain-Driven Design, CQRS, SOLID, Identity Server 4, Blazor. It will focus on resolving the problems always see in the process to develop projects.
Stars: ✭ 77 (+492.31%)
Mutual labels:  mvc, aspnetcore
Home
Home for Blazor Extensions
Stars: ✭ 51 (+292.31%)
Mutual labels:  aspnetcore, asp-net-core
aspnetcore-authentication-apikey
Easy to use and very light weight Microsoft style API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, Authorization Header, QueryParams or HeaderOrQueryParams.
Stars: ✭ 215 (+1553.85%)
Mutual labels:  aspnetcore, asp-net-core
kontent-boilerplate-net
Kontent.ai Boilerplate for development of ASP.NET Core MVC applications.
Stars: ✭ 29 (+123.08%)
Mutual labels:  mvc, asp-net-core

MvcSimplePager

Type Status
lincense license
travis Build Status
appveyor Build status
nuget WeihanLi.AspNetMvc.MvcSimplePager
codecov codecov

Intro

MvcSimplePager 是为解决分页的而做的一个通用、扩展性良好的轻量级分页扩展,可以自定义分页时调用的方法,自定义分页所用的样式,样式与代码分离,维护方便。

同时支持 asp.net mvc与 asp.net core

网上有许多分页都是查询所有数据再从中查询某一页的数据,但是个人感觉数据很少时还可以,如果数据比较多这样根本是不可行的,需要哪一页数据再查询哪一页的数据才是正确的做法,才能一定程度上提高查询的效率。

在网上看了几个分页组件,感觉分页的 html 代码和 CSharp 代码都有不同程度上的耦合,都不是特别满意, 于是自己封装了一个分页组件,基本可以实现 html 代码与 CSharp 代码的完全分离。

GetStarted

  1. 引用 MvcSimplePager 程序集(可通过Nuget安装包:Install-Package WeihanLi.AspNetMvc.MvcSimplePager,也可从 Nuget.org 下载)

  2. 在项目中Shared目录下创建自己的分页视图,可以根据 MvcSimplePagerDemo 项目下 Views 下的 Shared 目录中的 _PagerPartial 、 PagerPartial 和 PagerPartial1 三个分页视图进行修改

  3. 编写Controller 代码,在需要分页的 Action 中构建 PagerModel 和 PagedListModel,并根据需要设置每组分页显示页码数量

  4. 在需要分页的视图中引用 @Html.Pager 扩展方法,并设置必要的分页信息参数

  5. 建议在 Views 引用的命名空间中加入 WeihanLi.AspNetMvc.MvcSimplePager 以更方便的使用,添加命名空间方法如下:

    • asp.net mvc

    在 Views 目录下面的 web.config 文件中的 system.web.webPages.razor 节点下 pagednamespaces 节点下增加 WeihanLi.AspNetMvc.MvcSimplePager 命名空间 效果如下:

    <system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
            <namespaces>
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization"/>
                <add namespace="System.Web.Routing" />
                <add namespace="ActivityReservation" />
                <add namespace="WeihanLi.AspNetMvc.MvcSimplePager" />
            </namespaces>
        </pages>
    </system.web.webPages.razor>
    • asp.net core

    在 Views 目录下面的 _ViewImports.cshtml 文件中增加对命名空间 WeihanLi.AspNetMvc.MvcSimplePager 的引用,效果如下:

    @using AccountingApp
    @using WeihanLi.AspNetMvc.MvcSimplePager
    @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
  6. 更多使用可参考下面的 Samples

Samples

asp.net project sample: https://github.com/WeihanLi/ActivityReservation

asp.net core project sample: https://github.com/WeihanLi/AccountingApp

Notice

注:原 MvcSimplePager 包已不再维护,功能迁移至 https://github.com/WeihanLi/WeihanLi.Web.Extensions/tree/dev/src/WeihanLi.Web.Extensions/Pager,请使用 WeihanLi.Web.Extensions 包替代

Contact

如果您在使用过程中遇到什么问题,您可以随时联系我:[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].