If your are writing a plain string
with the @
sign to the response razor automatically html encodes it for you.
Because Html.Pager
returns just a plain string
containing the html so you need to use Html.Raw
to prevent the automating encoding in Razor:
So you need to change your Pager partial view to:
@Html.Raw(Html.Pager(Model)
.First("First")
.Last("Last")
.Next("Next")
.Previous("Previous").ToString())