Mvc paging component MvcSimplePager code reconstruction, mvcmvcsimplepager

Source: Internet
Author: User

Mvc paging component MvcSimplePager code reconstruction, mvcmvcsimplepager

1 Mvc paging component MvcSimplePager code Reconstruction

1.1 Intro

1.2 MvcSimplePager code optimization

1.3 MvcSimplePager

1.4 End

Mvc paging component MvcSimplePager code refactoring Intro

MvcSimplePager is a general and scalable lightweight paging extension designed to solve paging. It allows you to customize the methods called during paging, customize the pagination style, and separate the style from the code, easy to maintain.

Many pages on the Internet are used to query data on a certain page from all the data. However, when I feel that the data is very small, it is not feasible if the data is large, which page of data is required and which page of data is queried is the correct method, in order to improve the query efficiency to a certain extent.

After reading several paging components on the internet, I felt that the html code and CSharp code on pages were not very satisfied, so I encapsulated a paging component myself, basically, html code and CSharp code can be completely separated.

MvcSimplePager code optimization

MvcSimplePager is the http://www.cnblogs.com/ben121011/p/5913797.html starting like this

MvcSimplePager starts by coupling the paging style and paging event in the code, separating the paging event, and finally separating the paging style.

After that, the BUG is modified and the code is optimized and reconstructed.

Display data usage on the ViewforeachDuring Data traversal, Model. Data is required for Data traversal, and then optimized to be a Model, as shown below:

foreach(var item in Model)

 

 

When V1.0 is used, there is no GroupSize. To make it easier to use it, a GroupSize is added to help achieve better paging, I didn't know why I added a verification GroupSize limit when I was just adding it. [cover your face... ]. The previous version has been removed.

In short, we hope that this paging component can solve the paging problem and make it easier to use and code more and more beautifully.

The following describes how to use

MvcSimplePager uses End

Now you have packaged the MvcSimplePager project into Nuget http://www.nuget.org/packages/mvcsimplepager/. you can search for MvcSimplePager in the nuget Package Manager in.

Custom MvcSimplePager project and sample code: https://github.com/WeihanLi/MvcSimplePager, you can customize as needed.

If MvcSimplePager has nothing to do with your needs, feel free to contact me and look forward to your suggestions and feedback ben121011@126.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.