【发布时间】:2020-04-20 12:49:58
【问题描述】:
当我有一个设置了值的对象时,如果我省略了"--Select--" 参数,它只会在最初显示。
知道为什么会这样吗?
@Html.DropDownListFor(m => m.FlightDetails.AirlineId, ViewBag.AirlineList as SelectList, "--Select--", new { @class = "form-control selectpicker", @data_live_search = "true", @id = flight.Id + "AirlineId" })
【问题讨论】:
-
@ZorgoZ 不,它没有
-
应该的。你是如何填充你的 SelectList 的?
-
看看这个:nimblegecko.com/…
标签: asp.net-mvc bootstrap-4 bootstrap-select