public ActionResult Contact() { ViewBag.Message = "Your contact page."; var vm = new ContactViewModel(); ViewBag.ViewModel = vm; if (Request.IsAjaxRequest()) { return PartialView("PartialContact"); } return View(); }
public ActionResult Contact(ContactViewModel vm) { if (ModelState.IsValid) { _provider.AddContactInfo(vm.ToModel()); if(Request.IsAjaxRequest()) return PartialView("PartialRegistrationConfirmation"); return View("PartialRegistrationConfirmation"); } return View(); }