MVC4 SelectList not selected default object
问题 My select list isn't selecting the default object being brought in through code. I first create my SelectList like so: public SelectList CreateSelectList(object objSelected = null) { return new SelectList(GetAll().OrderBy(s => s.NumericalValue), "PeriodID", "Name", objSelected); } My objSelected gets filled with a Guid that's associated with the PeriodID. Inside my controller I define my viewbag variable to the new select list. public ActionResult Edit(Guid id) { Classroom classroom =