コード例 #1
0
 public ActionResult Save(SampleViewModel model)
 {
     if (model.Id == -1)
     {
         _sample.Create(model);
     }
     else
     {
         _sample.Update(model);
     }
     return
         (Json(
              new
     {
         redirectTo = Url.Action("Index", "Home", new { Area = "" }),
         message = "Record Saved successfully!!!",
         position = "mainContent"
     }));
 }