JQuery pagination use of page plug-ins

Source: Internet
Author: User

One, the reference CSS and JS:

<href= "/content/plugins/jquery.pagination_v2.2/pagination.css"  rel = "stylesheet"     type= "text/css"/><src= "/content/ Plugins/jquery.pagination_v2.2/jquery.pagination.js "  type=" Text/javascript " ></script>
View Code

Second, HTML:

<id= "Pagination"  class= "Flickr"  style= " margin-top:10px; margin-left:10px; " > </ Div >
View Code

Third, JS:

$(function () {    varTotal = parseint ("@ (viewbag.total)"); varpage = parseint ("@ (viewbag.page)")-1; varPageSize = parseint ("@ (viewbag.pagesize)"); $("#Pagination"). Pagination (Total, {callback:function(page_id) {window.location= "Boardlist?page=" + page_id + "&pagesize=" + This. Items_per_page; }, //Pagecallback () calls the secondary function for page flipping. Prev_text: "Prev", Next_text:"Next Page", Items_per_page:10,//number of data per pageNum_display_entries:1,//number of page entries on both sidesCurrent_page:page,//Current page numberNum_edge_entries:11//number of page entries in the main part of a continuous page    });});
View Code

Four, backstage code:

 PublicActionResult boardlist () {Pagermodel pager=NewPagermodel (); if(request["page"] ==NULL) {Pager.page=1; Pager.rows=Ten; Pager.sort="Id"; Pager.order="desc"; }    Else{pager.page=int. Parse (request["page"]) +1; Pager.rows=int. Parse (request["pageSize"]); Pager.sort="Id"; Pager.order="desc"; } boardmanageservice.getlist (refPager); List<BoardModel> boardlist = Pager.result asList<boardmodel>; viewdata["boardmodellist"] =boardlist; Viewbag.page=Pager.page; Viewbag.total=pager.totalrows; Viewbag.pagesize=pager.rows; returnView ();}#endregion
View Code

JQuery pagination use of pagination plug-ins

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.