Пример #1
0
 public ActionResult AjaxPost(SampleViewModel model)
 {
     if (ModelState.IsValid)
     {
         return Content(string.Format("Post (Ajax) new value = {0}", model.Value));
     }
     return Content("Invalid model!");
 }
Пример #2
0
 public ActionResult HtmlPost(SampleViewModel model)
 {
     if (ModelState.IsValid)
     {
         model.Message = string.Format("Post new value = {0}", model.Value);
     }
     return View("Index", model);
 }