Here is what I have in the controller:
IList<LocationInFacility> locs = LocationsInFacility(custCodeID);
ViewData["LocationsInFacility"] = new SelectList(locs, "ID", "Name", "DL");
Here is the view:
<label>Location in Facility</label>
<%= Html.DropDownList
("LocationsInFacility",(SelectList)ViewData["LocationsInFacility"]) %>
Here is the html output, I would have expected "DL" to be selected but it's not:
<select id="LocationsInFacility" name="LocationsInFacility">
<option value="">-- Select a Location in Facility --</option>
<option value="DL">DELI</option>
<option value="BK">BAKERY</option>
</select>
Why is "DL" not selected? What am I doing wrong?