Author: leadmagnet | Posted on: 6/23/2008 5:26:47 AM | Views : 284

I've written code to populate a DropDownList control in teh Page_Load event.

One of the things I'm doing is adding a Attribute to the ListItem for additional data, like this
Dim mylistitem1 As New ListItem
mylistitem1.Text = "List Item display text"
mylistitem1.Value = 0
mylistitem1.Attributes("tag") = "More Data"
myDropDownList.Items.Add(mylistitem1)

The page is being rendered fine. I get correctly formatted as expected

<option value="0" tag="More Data">List Item display text</optio ...

Go to the complete details ...