public ActionResult AddTaskToDb(Task newTask) { if (ModelState.IsValid) { DAO.AddTaskToDb(newTask); TempData["Message"] = "Task saved successfully."; } else { TempData["Message"] = "Something went wrong."; } return(RedirectToAction("Index")); }