public ActionResult Search(SearchModel searchModel, string submit) { if (submit == "Search") { ObservableCollection<QuoteModel> quotes = new ObservableCollection<QuoteModel>(); QuoteModel q = new QuoteModel(); q.symbol = searchModel.symbolSearch; quotes.Add(q); quotes = _dataFetchService.fetchData(quotes); TempData["quotes"] = quotes; return RedirectToAction("Results"); } else return View(); //just to make the compiler happy }
public ActionResult Search() { SearchModel searchModel = new SearchModel(); searchModel.symbolSearch = ""; return View(searchModel); }