名称属性覆盖ASP.NET Core MVC中的Html.DropDownListFor

问题描述 投票:1回答:1
new { id = " dd" name = " myName" } 

未覆盖名称属性,如何对id编码名称属性进行覆盖

@Html.DropDownListFor(x => x.Customer.CustomerBiaoshi, Html.GetEnumSelectList<TgNetJZ.CustomerBiaoshi>(), "test",new { @class = "form-control custom-select" ,@id="ddd",@name="myName"})

我这样写总是显示模型名称Customer.CustomerBiaoshi,我想显示我设置的名称属性“ myName”

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9iN2xFSS5wbmcifQ==” alt =“在此处输入图像描述”>] 1

asp.net asp.net-core-mvc
1个回答
0
投票

您可以将下拉列表创建者的另一个版本用作

© www.soinside.com 2019 - 2024. All rights reserved.