示例#1
0
        public ActionResult Index(int page = 1)
        {
            DataPaging dataPaging = new DataPaging()
            {
                controller = "Home",
                action = "Index",
                parameter = "",
                page = page,
                maxPage = ContentRepository.getCountPage()
            };
            ViewBag.dataPaging = dataPaging;

            return View(ContentRepository.getPosts(page));
        }
示例#2
0
        //parameter - в данном случае тег
        public ActionResult Tag(string parameter, int page)
        {
            DataPaging dataPaging = new DataPaging()
            {
                controller = "Posts",
                action = "Tag",
                parameter = parameter,
                page = page,
                maxPage = ContentRepository.getCountPageByTag(parameter)
            };
            ViewBag.dataPaging = dataPaging;

            return View(ContentRepository.getPostsByTag(parameter, page));
        }