In my controller –
ViewBag.DatesEnum = new SelectList(_db.blah.Where(w => w.Active == true).AsEnumerable(), "ID", "Date");
In view –
@Html.DropDownListFor(m => m.blahDate, (SelectList)ViewBag.DatesEnum)
Ofc it’s a datetime value being passed in and I was wondering how best to convert it to a ToShortDateString.
Then you can display dropdown in your view.
It would be better if you add dropdown data to your model and skip using ViewBag.