mvc中如何使用MvcPager控件分页

参考网址:http://www.webdiyer.com/mvcpager/demo/datarows/#src

http://www.cnblogs.com/hbzzws/articles/2804727.html

第一步:下载MvcpPager的对应版本的dll,引用到项目

第二步:cshtml页面中顶部加入 @model PagedList<yefang.web.view.ye_userinfo>,

第三步:具体分页显示位置加入

@Html.Pager(Model,new PagerOptions{PageIndexParameterName = "id",PagerItemsSeperator = "",NumericPagerItemCount=15,CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>"},new {id="flickrpager"})

第四步:Controllers页面返回列表加入每页显示条数

return View(db.ye_userinfo.OrderByDescending(a => a.time).ToPagedList(id,10));

这样一个简单的分页就可以使用了

时间: 2025-01-17 11:19:49

mvc中如何使用MvcPager控件分页的相关文章

.net MVC模式下easyui datagrid控件分页

此参照一位仁兄代码,稍作修改 视图代码: <div id="tab" class="easyui-tabs" data-options="tools:'#tab-tools'" style="width:800px;height:400px"> <div title="****" style="padding:0px;"> <div class="

Qt qml中listview 列表视图控件(下拉刷新、上拉分页、滚动轴)

Qt qml中listview 列表视图控件(下拉刷新.上拉分页.滚动轴) 来源 https://www.cnblogs.com/surfsky/p/4352898.html 设置ListView涉及到将contentsY,即视图的可见部分的顶部,设置y为委托的值.另一个更改是interactive将视图设置为false.这样可以防止视图移动.用户不能再滚动列表或更改当前Item. contentY为列表上拉后列表左上角点距显示框左上解点的高度listView1.height为可显示部分的高度,

DevExpress 用户控件 分页(中)

说明: 1)具体调用请关注 看DevExpress 用户控件 分页(下) datanavi_ButtonClick 是DataNavigator的ButtonClikc事件 视图设计器: 分页用户控件后台代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using

AspNetPager控件分页使用方法

AspNetPager控件官方下载地址:http://www.webdiyer.com/aspnetpager/ 把控件加到项目中(添加自定义控件的方法),并把它拖放到页面上 <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="

DevExpress 用户控件 分页(上)

说明:使用用户控件分页,完成后,使用时非常简单,数据绑定,调用自己写的一个事件就OK了 前期准备工作: (1)添加一个用户控件 命名PageCtrl (2)打开代码:   [csharp] view plaincopyprint? //引用 using DevExpress.XtraEditors; //窗体继承 public partial class PageCtrl : DevExpress.XtraEditors.XtraUserControl (3)设置窗体属性 AutoScaleMo

android在代码中四种设置控件背景颜色的方法(包括RGB)

转载请注明出处: http://blog.csdn.net/fth826595345/article/details/9208771  TextView tText=(TextView) findViewById(R.id.textv_name); //第1种: tText.setTextColor(android.graphics.Color.RED);//系统自带的颜色类 // 第2种: tText.setTextColor(0xffff00ff);//0xffff00ff是int类型的数据

在现有WinForms应用中添加C1Themes主题控件

在本博客中,展示了如何在现有的WinForms应用中添加C1Themes控件支持. 本文使用名为C1dView Samples的应用程序,它包含C1Reports.它是基于C1Ribbon界面设计的C1Report/C1PrintDocument浏览应用程序.该应用最初没有包含主题的支持. C1DView示例下载:C1dView.zip (94.96 kb) (下载次数: 7) 如下描述的简单的步骤,为最终用户提供在程序中选择使用包含于C1Themes控件产品中的若干主题的支持.(请注意:在进行

转载 [WPF][C#]在WPF中内嵌WindowsForm控件-使用WindowsFormsControlLibrary

[WPF][C#]在WPF中内嵌WindowsForm控件-使用WindowsFormsControlLibrary 在[WPF][C#]在WPF中内嵌WindowsForm控件一文中为各位介绍了直接在WPF中使用XAML来嵌入Windows Form控件的作法,不过不是每个人都喜欢写XAML,而且有时候会需要把已经存在的Windows Form应用程序嵌入到WPF中,所以这次就来跟大家介绍怎么使用参考dll档的方式,把dll中的Windows Form加到WPF中. 都说了要使用Windows

winform中,如何控制控件位置随窗体的大小改变而改变

winform中,如何控制控件位置随窗体的大小改变而改变 有如下3种方法: 方法1 [csharp] view plaincopy using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace MarkPrint