1
如何根據以前的搜索設置默認值?選擇列表默認多選
@Html.DropDownListFor(m => m.Filter.FossilTypes,
new SelectList(Model.Filter.FossilsTypesOptions, "Name", "Name"),
new {
@multiple = "multiple",
@placeholder = "Choose one...",
@class = "SlectBox"
})
我想這
@Html.DropDownListFor(m => m.Filter.FossilTypes,
new SelectList(Model.Filter.FossilsTypesOptions, "Name", "Name", Model.Filter.FossilTypesDefault),
new {
@multiple = "multiple",
@placeholder = "Choose one...",
@class = "SlectBox"
})
其中切換IEnumerable
,Array
和List
之間Model.Filter.FossilTypesDefault
類型,但它沒有任何效果。
這有幫助!謝謝! –