C
Chuck Dascalos
Say for instance I had data like this...
BandID BestYear BandName
------ -------- --------
1 1991 Depeche Mode
2 1989 New Order
3 1985 The Smiths
etc...
I would like to use the asp:listbox control to display this data in its
generated html. The BandID would be the value of the row and BandName
would be what is displayed. I would however also like to add an attribute
to the <option> tag, so the final generated html would look something like
this...
<select name="GreatBandsListBox" id="GreatBandsListBox">
<option value="1" BestYear="1991">Depeche Mode</option>
<option value="2" BestYear="1989">New Order</option>
<option value="3" BestYear="1985">The Smiths</option>
</select>
I realize this is going to probably entail creating a custom control. I
see ways to add static attributes to the select tag. I want to add a data
bindable attribute to the option tag.
Any help would be greatly appreciated.
BandID BestYear BandName
------ -------- --------
1 1991 Depeche Mode
2 1989 New Order
3 1985 The Smiths
etc...
I would like to use the asp:listbox control to display this data in its
generated html. The BandID would be the value of the row and BandName
would be what is displayed. I would however also like to add an attribute
to the <option> tag, so the final generated html would look something like
this...
<select name="GreatBandsListBox" id="GreatBandsListBox">
<option value="1" BestYear="1991">Depeche Mode</option>
<option value="2" BestYear="1989">New Order</option>
<option value="3" BestYear="1985">The Smiths</option>
</select>
I realize this is going to probably entail creating a custom control. I
see ways to add static attributes to the select tag. I want to add a data
bindable attribute to the option tag.
Any help would be greatly appreciated.