public ActionResult EditCourse(int id) { CourseVM course = courseBll.getCourseById(id); List <CategoryVM> categories = courseBll.getAllCategories(); SelectList categsList = new SelectList(categories, "category_id", "category_name", course.category_id); ViewBag.categsList = categsList; List <servicesVM> services = serviceBll.getAllServices(); SelectList servicesList = new SelectList(services, "service_id", "service_name", course.service_id); ViewBag.servicesList = servicesList; List <instructorVM> instructors = InstructorBll.getAllIstructors(); SelectList instructorsList = new SelectList(instructors, "instructor_id", "instructor_name", course.instructor_id); ViewBag.instructorsList = instructorsList; ViewBag.activeState = course.isActive; return(PartialView(course)); }