【发布时间】:2020-06-19 03:49:24
【问题描述】:
我目前有一个如下所示的下拉列表
@Html.DropDownList("ItemID", null, "-- Select --", htmlAttributes: new { @class = "form-control chosen-select" })
产生一个默认值“-- Select --”
但我想改变这个,所以默认是模型中的当前 ItemID。
像这样的
@Html.DropDownList("ItemID", null, @Model.ItemID, htmlAttributes: new { @class = "form-control chosen-select" })
我怎样才能做到这一点?
【问题讨论】: