How can I rendering select list item with added attributes?
.NET (Core and Framework)
1
Posts
1
Posters
0
Views
1
Watching
-
I can add an attribute to each option in a drop-down list, using the System.Web.UI.WebControls.ListBox.Items.Item(ItemIndex).Attributes.Add() method, but they are ignored when the list is rendered to the web-page. How can I render them? I'm currently adding the controls as childern to a span element, and then using the span.RenderControl(output) method to do the heavy lifting. Is there a method that I can override that specifically renders the options?