public ActionResult NewStudent() { var listClass = _dMService.getAllClass(); if (listClass.Count > 0) { var listItems = new List <SelectListItem>(); foreach (var item in listClass) { listItems.Add(new SelectListItem { Text = item.ClassName, Value = item.Id.ToString() }); } ViewBag.lissClassItems = listItems; } return(View()); }
public ActionResult Index() { var listClass = _dmService.getAllClass(); return(View(listClass)); }