i have an asp.net mvc view with the following code to show a dropdown list:
<% = Html.DropDownList("filter", Model.MyList, Model.MyDefaultValue, new { @id = "filter", @class = "complete" })%>
Model.MyList is a List with my items and one blank one at top and Model.MYDefaultValue is a string.
When i run this it looks like it works but i get my default listed twice
so lets say my list is:
Ford
Toyota
Chevy
and my Default is Toyota
when i click on the drop down i get:
Toyota
Ford
Toyota
Chevy
you see Toyota was added as the first item and as the 4th item.