Adding Attributes to ListItem

J

j

Hi,
I would like to persist 3 values to each of my ListItems, Value, Text, and a
third value so that on postback I can reference them. I would think I could
use the li.Attributes.Add("Key",value) in my C# code when I create the
ListItem so that on the postback I could reference li.Value, li.Text, and
li.Key. However, the added Attribute does not become an attribute on the
rendered HTML (which is an <OPTION> ). Therefore, the Key attribute is lost
for the postback.

Am I missing something? It would seem that this would be part of the
Attributes class. I used this technique in DHTML coding (I think it was
refered to as Expando?) and wonder if Attributes supports what I am trying
to do across postbacks?

Thank you
 
A

AeriesUser

I'm grappling with exactly same problem. Were you able to find any resolution
to this issue??

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top