Asp. NET synchronous paging Mvcpager using the detailed

Source: Internet
Author: User
Recently contacted Mvcpager to make a note.

In fact, I like the front and back end of the separation, paging this thing is responsible for the end of the place, the back end without consultants, here Mvcpager a bit reminds me of the server control, after all, the use of HtmlHelper.

But it's very convenient. We used to write pagination, the backend will encapsulate a page<t> class, now we can use Mvcpager to provide us with good pagelist<t>, the function is a bit similar, but Mvcpager function to be powerful.

First, use Mvcpager this control, need the following support

1. Back-end MvcPager.dll references:

2. Front end needs Css:pagerstyles.css, as well as other theme style pictures (PS: My demo is used bootstrap) Js:jq,jquery.unobtrusive-ajax.min.js,mvcpager.js ( PS: Synchronous paging does not require all references, asynchronous paging is required to refer to, here we will first refer to the HA)

Second, using the method provided by Mvcpager Topagelist for paging query, take out the data, return to the front desk to display

This returns the Pagelist<userinfo> object to the foreground of the strongly typed view, notice here the form of the method= "get", because the page bar link is based on the URL to access the background, the search parameters are passed through the URL, If it becomes post, the search function will be invalidated.

The main is this picture, set the code of the page bar, here to use the Mvcpager paging function, is the extension of the HtmlHelper.

Three

  • Related Article

    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.