1

I have following code

@Html.Pager((IPagination)Model.FoundUsers).Last("<span class=\"last\">&nbsp</span>").First("<span class=\"first\">&nbsp</span>").Next("<span class=\"next\">&nbsp</span>").Previous("<span class=\"prev\">&nbsp</span>")

But it renders encoded and shows <span class="next"> on page.

I tried to used Html.Raw as suggested in Problem with razor view and mvccontrib grid pagination or How to make a pager with MVCContrib and Razor?

but it still does not work for me.

What am I doing wrong ?

Community
  • 1
  • 1
WaldiMen
  • 347
  • 2
  • 12

2 Answers2

4

I would assume that you are using MvcContrib v2 with Mvc4 (or possibly Mvc3)?

Either manually download the newer libraries from http://mvccontrib.codeplex.com or use the Raw method. So instead of this:

@Html.Pager((IPagination)Model.FoundUsers).Last("<span class=\"last\">&nbsp</span>").First("<span class=\"first\">&nbsp</span>").Next("<span class=\"next\">&nbsp</span>").Previous("<span class=\"prev\">&nbsp</span>")

You would instead have:

@Html.Raw(Html.Pager((IPagination)Model.FoundUsers).Last("<span class=\"last\">&nbsp</span>").First("<span class=\"first\">&nbsp</span>").Next("<span class=\"next\">&nbsp</span>").Previous("<span class=\"prev\">&nbsp</span>"))
DavidG
  • 113,891
  • 12
  • 217
  • 223
1

Perhaps it's because I am working in VB, but I had to get the appropriate string from the Pager object:

@Html.Raw(Html.Pager(Model).ToString)

I'm using MvcContrib 2.0.95 with MVC 3.

Daz
  • 2,833
  • 2
  • 23
  • 30