//this is the auto complete that will work on the fields public JsonResult AutocompleteSuggestions(string searchString) { var model = new CompetitionViewModel(); var suggestions = model.GetSuggestion(searchString); return Json(suggestions, JsonRequestBehavior.AllowGet); }
public ActionResult Index(CompetitionViewModel model) { if (ModelState.IsValid) { // BUILD COMPETITION ENTRY HERE!! // Using the model - see code there. model.SaveEntry(); //this will save the data that has been entered in the text fields into the database return View("Thankyou", model); //this will return the thank you page once it has all been saved } return View(model); }
//this is to do with the index view, it will return the form to enter data along with the question // GET: Competition public ActionResult Index() { var model = new CompetitionViewModel(); return View(model); }