public ActionResult Create(Role role) { try { var createdRole = _iFRole.Create(UserId, role); if (ModelState.IsValid) { TempData["message"] = "Role has been created, successfully!"; } return(RedirectToAction("Create")); } catch (Exception) { if (ModelState.IsValid) { // Do your stuff TempData["message"] = "Opps! Something went wrong. Please, try again."; } return(RedirectToAction("Create")); } }
public ActionResult Create(Role role) { var createdRole = _iFRole.Create(UserId, role); return(RedirectToAction("Index")); }