I am new to MVC, so sorry if I am being a bit thick. I am using VB
I am trying to fill an html drop down list using data from a db, but the first item is always selected, no matter what.
What am I doing wrong?
Here is my code - In the controller:
ViewData("MatchTypeList") = New SelectList(_db.GetMatchTypes.ToList(), "MatchTypeID", "MatchTypeName", SelectedValue)
And in the view
<%= Html.DropDownList("MatchType", CType(ViewData("MatchTypeList"), IEnumerable(Of SelectListItem)), "Any", New With {.class = "forminput"})%>