Question

@model SocialReader.BackOffice.Models.NewsAndCategories
@using MvcContrib.UI.Grid;
@using MvcContrib.UI.Pager;
@using MvcContrib.Pagination;
@using System.Linq;
@using SocialReader.BackOffice.Common;
@{
    ViewBag.Title = "News";
}

<h2>@ViewBag.Message</h2>
<p>
    @Html.ActionLink("Create News", "Create", "News")
</p>

@{Html.RenderPartial("Pager", Model.PagedViewModel.PagedList);}
@Html.Grid(Model.PagedViewModel.PagedList).Columns(column =>
{
    column.For(x => Html.ActionQueryLink(x.Title, "View", new { id = x.Id })).Named("Title").InsertAt(0);
    column.For(x => x.Category.Name).Named("Category").InsertAt(1);
    column.For(x => x.DateUpdated).Named("Date Updated").InsertAt(2);
    column.For(x => x.Published).Named("Is Published").InsertAt(3);
    column.For(x => x.ViewCount).Named("View Count").InsertAt(4);
    column.For(x => x.UserCreated).Named("Authoer").InsertAt(5);
}).Sort(Model.PagedViewModel.GridSortOptions).Attributes(@class => "grid-style")

I have this code that I m trying to paginate the News but pagination where you click next previous etc is not rendering I m seeing, plain HTML on the page instead of rendered HTML.

<div class='pagination'><span class='paginationLeft'>Showing 1 - 10 of 41 </span><span class='paginationRight'>First | Previous | <a href="/News/Index?page=2">Next</a> | <a href="/News/Index?page=5">Last</a></span></div>

This is what I see on the page instead of it rendered. I have checked the CSS and JS they are all included.

What am i doing wrong? any ideas?

Thanks

Était-ce utile?

La solution

use @Html.RenderPartial not @{Html.RenderPartial}

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top