public ActionResult Create(CourseAssign courseAssign) { if (ModelState.IsValid) { bool IsSaved = _courseAssignManager.Add(courseAssign); if (IsSaved) { ViewBag.Message = "Assign Successfully"; } else { ViewBag.Message = "Asasign Failed"; } } ViewBag.DepartmentId = new SelectList(_departmentManager.GetAll(), "Id", "Name"); var defaultSelectListItem = new List <SelectListItem>() { new SelectListItem() { Value = "", Text = "Select" } }; ViewBag.CourseId = defaultSelectListItem; ViewBag.TeacherId = defaultSelectListItem; return(View()); }