MVC Bug with Default DropDownList or ListBox HTML Helpers

There are a lot of examples out there on how to pass a SelectList or MultiSelectList object to an Html.DropDownList or Html.ListBox helper.  However, I couldn’t find anything that was explaining the problem I was having. In my app we have a Show object that represents a podcast.  Each show may have multiple Guest objects, which are accessed by the Show.Guests member. In the Admin controller I have the following Action method: public ActionResult EditShow(int id) { var show = _repository.Get<Show>(id); show.Guests.Load(); var guestList = new MultiSelectList(_repository.List<Guest>().OrderBy(g => g.Name), "Id", "Name", show.Guests.Select(g => g.Id)); ViewData["GuestsSelectList"] = guestList; return View(show); }Read More