// GET: Blog public ActionResult BlogHome(int?page, string searchString = null) { ViewBag.Tittle = "Blog"; ViewBag.ListContentCategory = _blogServices.ListContentCategory(); ViewBag.RecentBlog = _blogServices.ListRecentBlog(); ViewBag.BlogList = _blogServices.ListAll(null); ViewBag.banner = _blogServices.GetBanner(); var blogList = _blogServices.ListAll(searchString); int pageSize = 9; int pageNumber = (page ?? 1); var blogListPaged = blogList.ToPagedList(pageNumber, pageSize); var seo = _blogServices.GetSeo(); if (seo != null) { ViewBag.MetaTitle = seo.MetaTitle ?? string.Empty; ViewBag.MetaDescription = seo.MetaDescription ?? string.Empty; ViewBag.MetaKeyword = seo.MetaKeyWord ?? string.Empty; } return(View(blogListPaged)); }