ListItems attributes in a DropDownList are lost on postback?
A coworker showed me this:
A coworker showed me this:
I’ve just come across this bizarre thing that I was expecting to work in a different (logical) way, but it doesn’t. Is it a bug or a “feature”?
Is there any way to set a CSS class on an input item in a radio button list? I’d like to reference these form values by class in jQuery.
I need to produce with asp.net controls this structure, but ListItem doesn’t allow add properties and classes.
I am using dropdownlist in asp.net, it has collection of ListItem that represents the items of the dropdownlist, each ListItem has only two fields to hold the data, Value and Text fields, but those are not enough I would like to hold more data for each item. Let’s say Text1 and Text2 in additional fields, but at the same time I would like to preserve the same behavior of the DataBind() method of the dropdownlist.