// GET: New public ActionResult Index(int page = 1, long newCategoryId = 0, int newOrBlog = 1) { if (newOrBlog == 1) { GetViewBagRecentNew(1); GetViewBagNewCategory(1); var model = newRepository.GetAllNewCategoryIndex(page, "News", newCategoryId); return(View(model)); } else { GetViewBagRecentNew(2); GetViewBagNewCategory(2); var model = newRepository.GetAllNewCategoryIndex(page, "Blog", newCategoryId); return(View(model)); } }