I want the dropdownlist -
<asp:dropdownlist id="ddl1" Runat="server"></asp:dropdownlist>
to generate the html for the combo dynamically and include the "id" attribute for the list item. The final thing should like -
<select name="_ctl3:ddl1" id="_ctl3:ddl1" >
<option value="A" id="A">A</option>
<option value="B" id="B">B</option>
<option value="C" id="C">C</option>
I can set & retrieve the DataValueField, DataTextField from a table, but what should I do to show the ID attribute for the list item and also assign a value for it from the db.
I need the id attribute to handle some functionality through javascript
Hope the question makes sense.