我有幾個下拉模型,我需要添加引導窗體控件類。我正在努力轉換這個字符串來接受這個類。將類添加到@ html.DropDownListFor
我會很感激的幫助。
我已經把
, new { @class = "form-control"}
無處不在的行沒有成功。
@Html.DropDownListFor(model => model.SelectedSourceAccount, new
SelectList(Model.AllWithdrawalAccounts.Select(x => new {Value = x.Id, Text =
x.NameAndAvailableBalance}), "Value", "Text"), Model.SelectedSourceAccount)
不要給代碼唯一的答案。簡要解釋答案,以便對其他人也有幫助。 – Ravimallya 2014-10-08 05:18:08