Here is my code:
<%: Html.DropDownListFor(m => m.type, new SelectList(new[] { "something", "other", "third thing" }))%>
And m.type has a value of 1, which means that “other ” should be selected. But it isn’t. Why is this happening and how to solve it?
The reason this isnt working is because the select list items dont have a numerical value. If you look at your source code you will probably see that the value is the same as the text and not a number.
To fix this you need to build the select list adding in the numerical values as well.
So you may need to build up your select list like this: