根据单击添加的数字在Razor视图内添加Razor视图列表

时间:2020-06-04 18:52:31

标签: asp.net-mvc razor asp.net-mvc-5

我需要一些替代方法。

我的情况是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获取并返回它,我只需要一组新的眼睛来提供一些示例。

(不关心他的显示/隐藏逻辑,我在那部分上没问题)

0 个答案:

没有答案