Exemplo n.º 1
0
        public ActionResult CategoryPosts(string category, int page=1)
        {
            // get the posts by category

            var viewModel = new ListViewModel(_blogRepository,page, category);
            ViewBag.Title = category;
            return View("CategoryList", viewModel);
        }
Exemplo n.º 2
0
        public ViewResult Posts(int page = 1)
        {
            // pick latest 10 posts
            var viewModel = new ListViewModel(_blogContext, page);

            ViewBag.Title = "Programing Traffic";

            return View("FullList", viewModel);
        }
Exemplo n.º 3
0
        public ActionResult InfinateScroll(int page=1)
        {
            // pick latest 10 posts
            var viewModel = new ListViewModel(_blogRepository, page);
            JsonModel_ListView jsonModel = new JsonModel_ListView();
            jsonModel.NoMoreData = page >= viewModel.totalPages;
            jsonModel.HTMLString = RenderPartialViewToString("_PartialList", viewModel.Posts);

            if (HttpContext.Request.HttpMethod == "GET")
                return Json(jsonModel, JsonRequestBehavior.AllowGet);
            else
                return Json(jsonModel);
            //return PartialView("List_Partial", viewModel);
        }