This is the code:
@using SSA.Models;
<h2>@ViewBag.Title.ToString()</h2>
@{
using(Html.BeginForm()){
List<SelectListItem> selectList = new List<SelectListItem>();
foreach(Item c in ViewBag.Items)
{
SelectListItem i = new SelectListItem();
i.Text = c.Name.ToString();
i.Value = c.SiteID.ToString();
selectList.Add(new SelectListItem());
}
Html.DropDownList("Casinos", new SelectList(selectList,"Value","Text"));
}
}
The list, selectList, on breakpoint shows it has 108 values. What renders is an empty form. No run time errors.
Note: I know using the ViewBag for this is not the best method. This is throw-away code and I'd just like to understand why it is not rendering the dropdown.