dropdown question
What is wrong with this ?
<%=Html.DropDownListFor(m=>m.Client,null,"Select",new { @style = "width: 630px" })%>
There is a ViewData["Client"] which contanins the source , the dropdown is filled but is not selected the value corresponding to Model.Clie开发者_如何学Pythonnt
Change ViewDate["Client"] to ViewData["ClientList"] and put it instead of null .Dont forget to cast it to SelectList.
<%=Html.DropDownListFor(m=>m.ClientId,(SelectList)ViewData["ClientList"],"Select",new { @style = "width: 630px" })%>
Hope this helps.
精彩评论