public ActionResult GetWeekDaysCheckboxes(int?counterID) { try { if (counterID.HasValue) { return(PartialView("_WeekDaysCheckBoxes", _convertService.GetWeekDayViewModelsForPartial((int)counterID).AsEnumerable())); } else { return(View("Error")); } } catch (Exception) { TempData["ErrorMessage"] = "Something went wrong when trying to get the checkboxes"; return(View("Error")); } }