Reputation: 63
I am using Html.DropdownList() html extension in ASP.NET MVC. It is currently generating the following html.
<select id="MyItems" name="MyItems">
<option value="1">Swimming</option>
<option selected="selected" value="2">Cycling</option>
<option value="3">Running</option>
</select>
I would like to have Id and name attributes for each 'option' element in the the 'select` element.
Any suggestions on how I could achieve it?
Thanks in advance.
Upvotes: 0
Views: 1451
Reputation: 11
Its not possible with Html.DropdownList()
you have option that you can generate this drop down using jquery then add this id and name attribute.
This will help you.
Upvotes: 1