设为首页 加入收藏

TOP

ASP.NETMVC 分页(一)
2019-09-17 18:57:38 】 浏览:195
Tags:ASP.NETMVC分页

<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>

这是前台页面,直接复制到前台最下面即可!

 

 

 

 

/* MvcPager source code
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.
*/
'use strict';
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;
首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/15/15
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C# 填充Excel图表、图例背景色 下一篇使用C# 操作存储过程,执行sql语..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目