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