public ViewResult Search(string txtSearch, int pageNumber = 1) { var viewModel = new ListViewModel(_repo, txtSearch, "Search", pageNumber); ViewBag.Title = string.Format(@"Lists of posts found for search text ""{0}""", txtSearch); return View("List", viewModel); }
// GET: Blog public ViewResult Posts(int pageNumber = 1) { var viewModel = new ListViewModel(_repo, pageNumber); ViewBag.Title = "Latest Posts"; return View("List", viewModel); }
public ViewResult Category(string category, int p = 1) { var viewModel = new ListViewModel(_blogRepository, category, "Category", p); if (viewModel.Category == null) throw new HttpException(404, "Category not found"); ViewBag.Title = String.Format(@"Latest posts on category ""{0}""", viewModel.Category.Name); return View("List", viewModel); }
public ViewResult Tag(string tag, int pageNumber = 1) { var viewModel = new ListViewModel(_repo, tag, "Tag", pageNumber); if (viewModel.Tag == null) throw new HttpException(404, "Tag not found"); ViewBag.Title = string.Format(@"Latest posts on tag ""{0}""", viewModel.Tag.Name); return View("List", viewModel); }
public ViewResult Tag(string tag, int p = 1) { var viewModel = new ListViewModel(_blogRepository, tag, "Tag", p); if (viewModel.Tag == null) throw new HttpException(404, "Tag not found"); ViewBag.Title = String.Format(@"Latest posts tagged on ""{0}""", viewModel.Tag.Name); return View("List", viewModel); }
public ViewResult Search(string s, int p = 1) { ViewBag.Title = String.Format(@"Lists of posts found for search text ""{0}""", s); var viewModel = new ListViewModel(_blogRepository, s, "Search", p); return View("List", viewModel); }
public ViewResult Posts(int p = 1) { var viewModel = new ListViewModel(_blogRepository, p); ViewBag.Title = "Latest Posts"; return View("List", viewModel); }