我就不说具体的操作过程了,上面的大神都描述的差不多了,源码如下:
$(document).ready(function () {
PageData("@ViewBag.TotalCount", "@ViewBag.PageSize", "@ViewBag.PageIndex" - 1);
function PageData(TotalCount, PageSize, PageIndex) {
$("#Pagination").pagination(TotalCount, {
callback: pageselectCallback,
prev_text: '上一页',
next_text: '下一页',
items_per_page:
PageSize,
num_display_entries: 3,
current_page: PageIndex,
num_edge_entries: 2,
gopage: '跳转到X页',
rowstxt: '共X条记录'
});
}
function pageselectCallback(pageIndex, jq) {
$("#PageIndex").val(pageIndex + 1);
$("#frmList").submit();
return false;
}