【发布时间】:2020-03-05 23:04:37
【问题描述】:
new { id = " dd" name = " myName" }
不在name属性上覆盖,id编码的name属性怎么覆盖
@Html.DropDownListFor(x => x.Customer.CustomerBiaoshi, Html.GetEnumSelectList<TgNetJZ.CustomerBiaoshi>(), "test",new { @class = "form-control custom-select" ,@id="ddd",@name="myName"})
我这样写总是显示模型名称Customer.CustomerBiaoshi,我想显示我设置的名称属性“myName”
应该是我编辑页面只能使用dropdownlistfor绑定下拉框选择item,所以需要解决name属性Customer.CustomerBiaoshi override和Model对应CustomerBiaoshi
或如何在 mvc 核心支持集名称属性 like so 上自定义下拉列表 htmlstring
【问题讨论】: