public ActionResult InsertCategory(CATEGORY category) { try { if (ModelState.IsValid) { categoryDA.Insert(category); return(RedirectToAction("Categories", "Admin")); } else { ViewBag.Error = "Try Again."; PopulateStateDropdownList(category.STATE_ID); return(View("CategoryInsert", category)); } } catch (Exception ex) { ViewBag.Error = "Try Again."; PopulateStateDropdownList(category.STATE_ID); return(View("CategoryInsert", category)); } }