B
Bob Krug
I have a DropDownList control to which I am adding 2 ListItems. For each
List Item I am setting the Value and Text as well as adding an attribute.
My code looks something like this:
Dim objItem as new ListItem
objItem.value = "1"
objItem.Text = "Value 1"
objItem.attributes("CrossRefValue") = "A"
MyDropList.items.add(objItem)
I do the same thing for the second item in the drop list. The problem is
that the attributes no longer exist after postback. The text & value
properties are still there, but no attributes. If I apply attributes to a
TextBox they persist between postbacks, why not the list items? Are
attributes not really supported for drop list items? I looked at the html
source of the rendered page and I don't see my attributes as part of the
"options" tag of the select object.
Thanks,
Bob
List Item I am setting the Value and Text as well as adding an attribute.
My code looks something like this:
Dim objItem as new ListItem
objItem.value = "1"
objItem.Text = "Value 1"
objItem.attributes("CrossRefValue") = "A"
MyDropList.items.add(objItem)
I do the same thing for the second item in the drop list. The problem is
that the attributes no longer exist after postback. The text & value
properties are still there, but no attributes. If I apply attributes to a
TextBox they persist between postbacks, why not the list items? Are
attributes not really supported for drop list items? I looked at the html
source of the rendered page and I don't see my attributes as part of the
"options" tag of the select object.
Thanks,
Bob