public ActionResult CreateActivityLogType(ActivityLogTypeModel model ) { if (ModelState.IsValid) { var activityType = new ActivityLogType() { Name = model.Name.Trim(), SystemKeyword = model.SystemKeyword.Trim() }; activityService.InsertActivityType(activityType); return Json(new { IsValid = true }); } //If we got this far, something failed, redisplay form return Json(new { IsValid = false, htmlData = RenderPartialViewToString("_CreateActivityLogType", model) }); }
public ActionResult CreateActivityLogType() { var model = new ActivityLogTypeModel(); return PartialView("_CreateActivityLogType", model); }