MvcPager无法正常工作 [英] MvcPager is not working

查看:70
本文介绍了MvcPager无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是mvcpager版本3.0.1.1



@ Ajax.Pager(Model,new PagerOptions {PageIndexParameterName =pageno,ShowDisabledPagerItems = true,ShowPrevNext = true,ShowFirstLast = false,PrevPageText =Previous,NextPageText =Next,PageNumberFormatString =,SeparatorHtml =  },new AjaxOptions {UpdateTargetId =divCategory})





在上面的代码中出现错误,如



i have using the mvcpager version 3.0.1.1

@Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "pageno", ShowDisabledPagerItems = true, ShowPrevNext = true, ShowFirstLast = false, PrevPageText = "Previous", NextPageText = "Next", PageNumberFormatString = "", SeparatorHtml = "  " }, new AjaxOptions { UpdateTargetId = "divCategory" })


In the above code the error is occured like

'Webdiyer.WebControls.Mvc.PagerOptions' does not contain a definition for 'SeparatorHtml





请帮帮我..

提前致谢



pls Help me..
Thanks in advance

推荐答案

查看源代码 [ ^ ],错误消息(不出所料)是正确的。 PagerOptions 类没有名为 SeparatorHtml 的属性。



要修复代码,请从对象初始化程序中删除该属性:

Looking at the source code[^], the error message is (unsurprisingly) correct. The PagerOptions class does not have a property called SeparatorHtml.

To fix your code, remove that property from your object initializer:
@Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "pageno", ShowDisabledPagerItems = true, ShowPrevNext = true, ShowFirstLast = false, PrevPageText = "Previous", NextPageText = "Next", PageNumberFormatString = "" }, new AjaxOptions { UpdateTargetId = "divCategory" })

@Html.Raw(Ajax.Pager(
       new Options
       {
           PageSize = Model.PageSize,
           TotalItemCount = Model.TotalItemCount,
           CurrentPage = Model.PageNumber,
           ItemTexts = new ItemTexts() { Next = "Next", Previous = "Previous", Page = "P" },
           ItemIcon = new ItemIcon() { First = "icon-backward", Previous = "icon-chevron-left", Next = "icon-chevron-right", Last = "icon-forward" },
           TooltipTitles = new TooltipTitles() { Next = "Next page", Previous = "Previous page", Page = "Go to page {0}.", First = "Go To First Page", Last = "Go To Last Page" },
           Size = Size.normal,
           Alignment = Alignment.centered,
           IsShowControls = true,
           IsShowFirstLast = true
       },
       new AjaxOptions
       {
           UpdateTargetId = "grid-list",
           OnBegin = "beginPaging",
           OnSuccess = "successPaging",
           OnFailure = "failurePaging"
       }, new { controller = "


请参考此演示: https://twittstrap.com/ajax-paging-with-bootstrap-in-mvc-4/ [ ^ ]

http://mvcpaging.apphb.com/
please refer this demo : https://twittstrap.com/ajax-paging-with-bootstrap-in-mvc-4/[^]
http://mvcpaging.apphb.com/


这篇关于MvcPager无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆