示例#1
0
        public ActionResult MasterGridViewPartialAddNew(dnGroupMVC01.Areas.DemoClientSideShowHide.Models.Master item)
        {
            var model = MasterList.GetData();

            if (ModelState.IsValid)
            {
                try
                {
                    // Insert here a code to insert the new item in your model
                    MasterList.AddItem(item);
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_MasterGridViewPartial", model));
        }