Reputation: 3158
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
Upvotes: 0
Views: 1713
Reputation: 3158
I fixed it. It was not working because, it was returning string whereas MVC3 was excepting MVCHtmlString.
Thanks everyone.
Upvotes: 1
Reputation: 1039080
Assuming your model is a PagedList<T>
and it is not null or empty, the following should work:
@model Webdiyer.WebControls.Mvc.PagedList<Foo>
@Html.AjaxPager(Model, new PagerOptions(), new AjaxOptions())
Then try adding options incrementally to see what's the problem.
Upvotes: 0