/// <summary> /// <c>Index</c> is a method in the <c>HomeController</c>. /// It post articles on the page from DB. /// </summary> public ViewResult Index() { ArticleR articleR = new ArticleR(); ViewBag.Articles = articleR.GetAll(); return(View()); }
public ViewResult GetArticles(string h) { ArticleR articleR = new ArticleR(); var temp = articleR.GetAll(); var art = temp.Where(a => a.Text.Contains(h)); ViewBag.Articles = art; return(View("Index")); }