亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery Pagination分頁(yè)插件使用方法詳解

 更新時(shí)間:2017年02月28日 09:58:50   作者:秋荷雨翔  
這篇文章主要為大家詳細(xì)介紹了jQuery Pagination分頁(yè)插件的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了jQuery Pagination分頁(yè)插件的具體代碼,供大家參考,具體內(nèi)容如下

一、引用CSS和JS:

<link href="/Content/Plugins/jQuery.Pagination_v2.2/pagination.css" rel="external nofollow" rel="stylesheet"
 type="text/css" />
<script src="/Content/Plugins/jQuery.Pagination_v2.2/jquery.pagination.js" type="text/javascript"></script>

二、HTML:

<div id="Pagination" class="flickr" style="margin-top: 10px; margin-left: 10px;">
</div>

三、JS:

$(function () {
 var total = parseInt("@(ViewBag.total)");
 var page = parseInt("@(ViewBag.page)") - 1;
 var pageSize = parseInt("@(ViewBag.pageSize)");

 $("#Pagination").pagination(total, {
 callback: function (page_id) {
  window.location = "BoardList?page=" + page_id + "&pageSize=" + this.items_per_page;
 }, //PageCallback() 為翻頁(yè)調(diào)用次函數(shù)。
 prev_text: " 上一頁(yè)",
 next_text: "下一頁(yè) ",
 items_per_page: 10, //每頁(yè)的數(shù)據(jù)個(gè)數(shù)
 num_display_entries: 1, //兩側(cè)首尾分頁(yè)條目數(shù)
 current_page: page, //當(dāng)前頁(yè)碼
 num_edge_entries: 11 //連續(xù)分頁(yè)主體部分分頁(yè)條目數(shù)
 });
});

四、后臺(tái)代碼:

public ActionResult BoardList()
{
 PagerModel pager = new PagerModel();
 if (Request["page"] == null)
 {
 pager.page = 1;
 pager.rows = 10;
 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(ref pager);
 List<BoardModel> boardList = pager.result as List<BoardModel>;
 ViewData["BoardModelList"] = boardList;
 ViewBag.page = pager.page;
 ViewBag.total = pager.totalRows;
 ViewBag.pageSize = pager.rows;

 return View();
}
#endregion

更多精彩內(nèi)容請(qǐng)點(diǎn)擊:jquery分頁(yè)功能匯總進(jìn)行學(xué)習(xí)。

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論