public ActionResult IndexAjax(string searchQuery) { IEnumerable <DataModelView> resultlist; resultlist = DataModelView.GetDataModelList().Where(p => p.Name.Contains(searchQuery) || searchQuery == p.Name + " " + p.FileName).ToArray(); return(PartialView("ResultView", resultlist)); }
public ActionResult Index(string searchQuery) { IEnumerable <DataModelView> resultlist; resultlist = DataModelView.GetDataModelList().ToArray(); return(View(resultlist)); }
public ActionResult PersonSuggestion(string term) { var personList = DataModelView.GetDataModelList().Where(p => p.Name.Contains(term)); return(Json(personList, JsonRequestBehavior.AllowGet)); }