public ActionResult Index(SearchPage currentPage, string q) { var model = new SearchPageViewModel(currentPage); if (q != null) { model.SearchText = q; model.Search(q); } return(View(model)); }
public ActionResult Index(SearchPage currentPage, string q) { /* Implementation of action. You can create your own view model class that you pass to the view or * you can pass the page type for simpler templates */ var model = new SearchPageViewModel(currentPage); if (q != null) { model.SearchText = q; model.Search(q); } return(View(model)); }
private async void Search_Clicked(object sender, EventArgs e) { await viewModel.Search(viewModel.Query); }