From f5c33c367a4c7b834d7c684c008180a35af071bc Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Apr 2017 09:20:05 -0400 Subject: paginate forum posts --- Project-Unite/Views/Forum/ViewTopic.cshtml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Project-Unite/Views/Forum/ViewTopic.cshtml') diff --git a/Project-Unite/Views/Forum/ViewTopic.cshtml b/Project-Unite/Views/Forum/ViewTopic.cshtml index a9272b6..704566f 100644 --- a/Project-Unite/Views/Forum/ViewTopic.cshtml +++ b/Project-Unite/Views/Forum/ViewTopic.cshtml @@ -1,4 +1,5 @@ -@model Project_Unite.Models.ForumTopic +@using Project_Unite.Controllers; +@model Project_Unite.Models.ForumTopic @using Microsoft.AspNet.Identity @{ ViewBag.Title = Model.Subject; @@ -30,7 +31,7 @@ Html.RenderPartial("~/Views/Shared/_ModeratorBar.cshtml", Model); } -@foreach (var post in Model.Posts.OrderBy(x => x.PostedAt)) +@foreach (var post in Model.Posts.OrderBy(x => x.PostedAt).GetItemsOnPage(ViewBag.Page, ViewBag.PageSize)) { if (Request.IsAuthenticated) { @@ -75,3 +76,17 @@ @{ Html.RenderPartial("~/Views/Shared/_ModeratorBar.cshtml", Model); } + + \ No newline at end of file -- cgit v1.2.3