使用 razor 语法的 asp.net mvc 分页器
我正在开发一个项目,尝试渲染寻呼机(来自 http://en.webdiyer.com/) 使用 Razor 语法。这是代码行。我使用的是asp.net mvc3。
@Html.AjaxPager(Model,
new PagerOptions() {
PageIndexParameterName = "page",
CurrentPagerItemWrapperFormatString = "<span class=\"active\">{0}</span>",
NumericPagerItemWrapperFormatString = "<span>{0}</span>",
ShowDisabledPagerItems = false,
NavigationPagerItemWrapperFormatString = "<span>{0}</span>",
MorePagerItemWrapperFormatString = "<span>{0}</span>",
CssClass = "pagination-digg",
NumericPagerItemCount = 7,
SeparatorHtml = ""
},
new AjaxOptions() {
UpdateTargetId = "dvData",
})
但它不渲染 html。
帮助将不胜感激。
问候 帕明德
I working on a project where I am trying to render a pager(from http://en.webdiyer.com/) with razor syntax. Here is code line. I am using asp.net mvc3.
@Html.AjaxPager(Model,
new PagerOptions() {
PageIndexParameterName = "page",
CurrentPagerItemWrapperFormatString = "<span class=\"active\">{0}</span>",
NumericPagerItemWrapperFormatString = "<span>{0}</span>",
ShowDisabledPagerItems = false,
NavigationPagerItemWrapperFormatString = "<span>{0}</span>",
MorePagerItemWrapperFormatString = "<span>{0}</span>",
CssClass = "pagination-digg",
NumericPagerItemCount = 7,
SeparatorHtml = ""
},
new AjaxOptions() {
UpdateTargetId = "dvData",
})
But it doesnt render the html.
Help will be appreciated.
Regards
Parminder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我修好了。它不起作用,因为它返回字符串,而 MVC3 除外 MVCHtmlString。
谢谢大家。
I fixed it. It was not working because, it was returning string whereas MVC3 was excepting MVCHtmlString.
Thanks everyone.
假设您的模型是
PagedList
并且它不为 null 或空,则以下操作应该有效:然后尝试逐步添加选项以查看问题所在。
Assuming your model is a
PagedList<T>
and it is not null or empty, the following should work:Then try adding options incrementally to see what's the problem.