//Partial index that returns list of classes public ActionResult partIndex(FormCollection collection) { var sem = collection["sem_list"] ?? ""; var viewModel = new ClassManagerIndexViewModel { Semesters = db.Semesters.ToList(), Classes = db.Classes.Where(c => sem == "" || c.semster_id == sem).ToList() }; return PartialView(viewModel); }
//Index of Class Manager public ActionResult Index() { var viewModel = new ClassManagerIndexViewModel { Semesters = db.Semesters.ToList(), Classes = db.Classes.ToList() }; return View(viewModel); }