在使用Ajax.Pager进行分页的时候需要注意一下几个方面:
1、一定要引入jquery.unobtrusive-ajax.min.js这个js;
2、一定要在页面中使用注册分页器,注册方法:@{Html.RegisterMvcPagerScriptResource();};
具体的使用方法示例:
| 代码如下 | 复制代码 |
|
@{ PagerConfig pagerConfig = new PagerConfig("pageIndex", "pageIndexBox", "goToBtn"); PagerOptions options = pagerConfig.GetPagerOption(); } @Ajax.Pager(Model, options).AjaxOptions(a => a.SetUpdateTargetId("articles").SetHttpMethod("Post").SetDataFormId("searchView"))
跳转
|
|
其中Model是IpagedList对象,获取PagerOptions的方法如下:
| 代码如下 | 复制代码 |
|
/// /// 翻页配置项 /// /// publicPagerOptions GetPagerOption() { PagerOptions options =newPagerOptions { AutoHide =false, FirstPageText ="首页", LastPageText ="尾页", NextPageText ="下一页", PrevPageText ="上一页", PageIndexParameterName =this._pageIndexParaName, ContainerTagName ="ul", CssClass ="pagination", CurrentPagerItemTemplate =" ",DisabledPagerItemTemplate =" ",PagerItemTemplate =" {0}",PageIndexBoxId =this._pageIndexBoxId, GoToButtonId =this._goToButtonId, NumericPagerItemCount = 5 };
returnoptions; } |
|
uc浏览器网页版入口官网-手机/电脑uc浏览器网页版入口地址
little fox官方网站入口地址-little fox网页版中国官网入口地址
樱花动漫网官网在线观看入口-樱花动漫网最新网页版入口地址2026
剑桥少儿英语官网入口网址-剑桥少儿英语网页版入口地址
手机百度网盘登录入口地址-百度网盘手机网页版登录入口地址
192.168.1.1无线路由怎么访问?192.168.1.1无线路由器设置登录入口地址