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.