3 回答

TA貢獻(xiàn)1821條經(jīng)驗 獲得超6個贊
@Html.DropDownListFor()
備選案文1EditorTemplate
)
EditorTemplate
/Views/Shared/EditorTemplates/AggregationLevelConfiguration.cshtml
@model yourAssembly.AggregationLevelConfiguration@Html.DropDownListFor(m => m.HelperCodeType, (SelectList)ViewData["CodeTypeItems"]).... // other properties of AggregationLevelConfiguration
SelectList
EditorTemplate
additionalViewData
@using (Html.BeginForm()){ ... @Html.EditorFor(m => m.Configurations , new { CodeTypeItems = Model.CodeTypeItems }) ...
備選案文2SelectList
selectedValue
)
CodeTypeItems
IEnumerable<GenericIdNameType>
SelectList
codeTypes
@Html.DropDownListFor(m => m.Configurations[0].HelperCodeType, new SelectList(Model.CodeTypeItems, "Id", "Name", Model.Configurations[0].HelperCodeType)
new { id = "Configurations[0].HelperCodeType"
DropDownListFor()
id
- 3 回答
- 0 關(guān)注
- 547 瀏覽
添加回答
舉報