我有一個靜態的SelectList 守則DropDownListFor
:如何將項目添加到具有Enumerable.Range列表項目的DropDownlistFor?
@Html.DropDownListFor(model => model.FinancialInfo.FinancialExpiryMonth,
new SelectList(Enumerable.Range(1, 12)),
(Model.FinancialInfo == null
|| Model.FinancialInfo.ExpiryDate == null)
? String.Empty
: null,
new { @class = "description-text" })
我需要的第一個項目是字Month
我該怎麼做這個靜態DropDownListFor
?
更換第三個參數用'「月」' –
@Stephen Muecke這將是一個月,但在編輯動作需要在S選擇的項目是一個值不是'「月」' –
需要選擇SelectedItem –