Asp. NET synchronous paging Mvcpager Use of detailed _ practical skills

Source: Internet
Author: User

Recently contacted a mvcpager, to make a note

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

But it's very convenient. Before we write pagination, the back end 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 the function of Mvcpager is strong.

Using the Mvcpager control, you need the following support

1. Back-end MvcPager.dll reference:

2. Front end needs Css:pagerstyles.css, as well as other theme-style images (PS: My demo is used by Bootstrap) Js:jq,jquery.unobtrusive-ajax.min.js,mvcpager.js ( PS: Synchronized paging does not need all references, asynchronous paging is required, here we are the first reference to Kazakhstan)

Second, the use of the method provided by Mvcpager topagelist paging query, take out data, return to the front desk to show

This returns a strongly-typed view of the Pagelist<userinfo> object to the foreground, noting the method= "get" of the form here, because the link to the page bar is based on the URL to access the background, the search parameters are carried through the URL of the past, If it becomes a post, then the search function will fail.

The main is this diagram , set the code of the page bar, where the use of Mvcpager paging function, is the extension of the HtmlHelper.

Third, the effect chart

More wonderful content You can also refer to the ASP. NET paging function operation to learn, I hope you like.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.