Exemple #1
0
        public ActionResult SavePartial(Customer model)
        {
            // Just for this demo, add some validations here
            if (String.IsNullOrEmpty(model.DisplayName))
                ModelState.AddModelError("DisplayName", "Name is required");

            return PartialView("_EditCustomer", model);
        }
Exemple #2
0
 public ActionResult Index()
 {
     var model = new Customer();
     return View(model);
 }