By default, @Html.DropDownListFor() is a convenient Razor helper to create a <select> tag containing <option> tags. But it is not possible to add custom attributes like “data-meow-xx=xxxx” to the option tags.

One solution is to create the <select> tag yourself:

Reference

 

Share This:

  [email protected]