public ActionResult Add() { List <SelectListItem> list = new List <SelectListItem>(); var l = cbll.GetAll(); foreach (var item in l) { list.Add(new SelectListItem() { Text = item.cTitle, Value = item.cId.ToString() }); } ViewBag.ClassList = list; return(View()); }
// GET: ClassInfo public ActionResult Index() { ViewData.Model = bll.GetAll(); return(View()); }