public ActionResult Tag(string tagId, int page = 1, int pageSize = 10) { var model = ContentBLL.ListAllByTag(tagId, page, pageSize); int totalRecord = 0; ViewBag.Total = totalRecord; ViewBag.Page = page; ViewBag.Tag = TagBLL.GetTag(tagId); int maxPage = 5; int totalPage = 0; totalPage = (int)Math.Ceiling((double)(totalRecord / pageSize)); ViewBag.TotalPage = totalPage; ViewBag.MaxPage = maxPage; ViewBag.First = 1; ViewBag.Last = totalPage; ViewBag.Next = page + 1; ViewBag.Prev = page - 1; return(View(model)); }