Skip to content

mvc dropdownlistfor why not support set name attributes #19631

@apchenjun

Description

@apchenjun

asp.net core mvc why not support set name attributes for dropdownlistfor controls

It should be for me that the edit page can only use dropdownlistfor to bind the drop-down box to select items, so I need to solve the name property Customer.CustomerBiaoshi override and Model corresponds to CustomerBiaoshi
@Html.DropDownListFor(x => x.Customer.CustomerBiaoshi, Html.GetEnumSelectList<TgNetJZ.CustomerBiaoshi>(), "test",new { @class = "form-control custom-select" ,@name="myName"})
image
I want to set the name property to myname instead of Customer.CustomerBiaoshi

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions