Example #1
0
 public ActionResult Edit2(int customerId)
 {
     var model = new HomeServices().Process(new HomeModel());
     ((HomeModel)model).Customer = ((HomeModel)model).Customers[0];
     ((HomeModel)model).Customer.CompanyName = "入力値エラー";
     return PartialView("_customerEditor2", ((HomeModel)model).Customer);
 }
Example #2
0
 /// <summary>
 /// For example Use customModelBinder only this Actions.
 /// </summary>
 /// <param name="inputModel"></param>
 /// <returns></returns>
 public ActionResult Index([ModelBinder(typeof(CustomModelBinder))] HomeModel inputModel)
 {
     var model = new HomeServices().Process(inputModel);
     return View(model);
 }
Example #3
0
 public ActionResult Edit([Bind(Prefix = "customerList")] int customerId)
 {
     var model = new HomeServices().Process(new HomeModel());
     ((HomeModel)model).Customer = ((HomeModel)model).Customers[customerId - 1];
     return PartialView("_customerEditor", ((HomeModel)model).Customers[customerId - 1]);
 }