public ActionResult Index( int? page) { int itemsOnPage = 10; int pg = page ?? 1; int totalArticles; ArticleDao articleDao = new ArticleDao(); IList<Article> articles = articleDao.GetArticlePaged( itemsOnPage, pg, out totalArticles); /* IList<BlogComment> comments = new BlogCommentDao().GetAll(); */ ViewBag.Pages = (int)Math.Ceiling( (double)totalArticles / (double)itemsOnPage ); ViewBag.CurrentPage = pg; ViewBag.Category = new ArticleCategoryDao().GetAll(); return View(articles); }