我需要一些替代方法。
我的情况是Razor View MVC 5:
<div>
@Html.LabelFor("How many items do you have to explain?", new { @class = "control-label" })
@Html.DropDownListFor( i => i.ItemCount,
new SelectListItem[]
{
new SelectListItem {Text = "", Value = ""},
new SelectListItem {Text = "1", Value = "1"},
new SelectListItem {Text = "2", Value = "2"},
new SelectListItem {Text = "3", Value = "3"},
new SelectListItem {Text = "4", Value = "4"},
new SelectListItem {Text = "5", Value = "5"}
}, new { @class = "form-control", })
</div>
<div class = "hidden-display" id="itemstoexplin"> @* After item is selected this section would be visible with items like: Name, Width, Height, Cost etc... Pretty much a form of options to fill out.
@*
!!! ~ LOGIC: WHERE CAN I ADD THE NEED VIEWS/PARTIALS BASED ON NUMBER SELECTED ABOVE FROM.
*@
</div>
对于CRUD方案,我在哪里可以从Htem.DropDownListFor中选择的数量中添加所需的视图/部分?
有什么例子吗?
它正在通过控制器推动它,或者通过JQuery获取并返回它,我只需要一组新的眼睛来提供一些示例。
(不关心他的显示/隐藏逻辑,我在那部分上没问题)