如何从下拉列表

时间:2018-02-28 18:43:29

标签: c# html asp.net-mvc razor

如何将默认值设置为PdvId = 3.我的IznosPdvSelectList中有五个值,我希望Id = 3

@Html.DropDownListFor
 (x => x.Nabava.PdvId,
 Model.Nabava.IznosPdvSelectList,
 "...",
 new { @class = "js-select2", id = "ddlIznosPdv"})

1 个答案:

答案 0 :(得分:0)

    @Html.DropDownListFor (x => x.Nabava.PdvId, Model.Nabava.IznosPdvSelectList, "...", new { @class = "js-select2", id = "ddlIznosPdv", Value=3})