Пример #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);
 }