コード例 #1
0
 public ActionResult Index()
 {
     InitializeViewBag("Gift list");
     var model = new GiftListModel
     {
         Gifts = new List<GiftModel>
     {
       new GiftModel {Title = "Tall Hat", Price = 49.95},
       new GiftModel {Title = "Long Cloak", Price = 78.25}
     }
     };
     return View(model);
 }
コード例 #2
0
 public ActionResult RemoveGift(GiftListModel model, int index)
 {
     model.RemoveGift(index);
     return Json(model);
 }
コード例 #3
0
 public ActionResult Save(GiftListModel model)
 {
     model.Save();
     return Json(model);
 }
コード例 #4
0
 public ActionResult AddGift(GiftListModel model)
 {
     model.AddGift();
     return Json(model);
 }