<div class="text-center">
<span style="display:inline-block; position:relative;top:-30px;">共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录,当前为第 @Model.CurrentPageIndex 页</span>
@Ajax.Pager(Model, new PagerOptions
{
/*
* 设置分页显示的样式
*/
FirstPageText = "首页",
LastPageText = "最后一页",
NextPageText = "下一页",
PrevPageText = "上一页",
PageIndexParameterName = "PageId",
ContainerTagName = "ul",
CssClass = "pagination",
CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>",
DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>",
PagerItemTemplate = "<li>{0}</li>"
},
new MvcAjaxOptions
{
HttpMethod = "post",
UpdateTargetId = "partList",//更新数据的标签ID
DataFormId = "form0" //分页对应的条件搜索表单ID
})
</div>
这是前台页面,直接复制到前台最下面即可!
This file is part of MvcPager.
Copyright 2009-2015 Webdiyer(http://en.webdiyer.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var Webdiyer = Webdiyer || {};
Webdiyer.MvcPagers = [];
Webdiyer.MvcPagers.getById = function (id) {
for (var i = 0; i <= this.length; i++) {
if (typeof this[i] !== "undefined" && this[i].id === id) {
return this[i];
}
}
return null;