Selected value in asp.net MVC 4.0 dropdownlist
问题 I am trying to make a dropdown list using DropdownListFor function and I want to have a value selected in it. I have searched a lot and found the similar kind of solution of having a SelectList object in the ViewModel , I tried it something like this In my ViewModel I used a property of type SelectList like this SelectList HoursToSelect = new SelectList(MyDictionaryObject, "Value", "Key", 14/*selected value*/); and I was using it like this @Html.DropDownListFor(m => m.EndsOnHour,