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

                return View("PartialRegistrationConfirmation");
            }
            return View();
        }