public ActionResult show() { RegattaViewModel rvm = new RegattaViewModel(); rvm.HandleRequest(); return(View(rvm)); }
public ActionResult Index(RegattaViewModel rvm) { rvm.IsValid = ModelState.IsValid; rvm.HandleRequest(); if (rvm.IsValid) { ModelState.Clear(); } else { foreach (KeyValuePair <string, string> item in rvm.ValidationErrors) { ModelState.AddModelError(item.Key, item.Value); } } return(View(rvm)); }