@this.Model.ActiveApplicationId
@this.Html.DropDownList("applications", new SelectList(this.Model.AllApplications, "ApplicationId", "Title", this.Model.ActiveApplicationId))
renders…
17
<select id="applications">
<option value="16">app 16</option>
<option value="17">app 17</option>
</select
There is no selected="selected" attr on the 2nd option, and there should be. So, by default, since none of them are selected, the 1st one is selected.
What am I missing? Thanks!
Why not use the strongly typed version? MVC does not respect the Selected value parameter of the SelectList.