In my ASP MVC site I want to be able to select a default drop down list item in the view. However, the overload I'm currently using seems to just add another item to the drop down list instead of specifying which one I want selected.
Here is the code in the controller that created the SelectList
SelectList tmpList = new SelectList(new[] { "", "SAF", "SNY" });
ViewBag.Companies = tmpList;
And here is the code in the view. This, however, just winds up adding an extra SAF
to the list like the screen shot below shows.
@Html.DropDownListFor(model => model.AgencyCompany1, (SelectList)ViewBag.Companies, "SAF")