Hi Rick, thanks for your help, yep, gettring the info from the database was
my second option but I was just trying to save a dbase call
Cheers
Mark
"Rick Spiewak" <ri*********@mindspring.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Adding attributes to the listitems doesn't actually do anything, even
though you can write the code that seems to do it. I would suggest just
retrieving the value from the table as needed.
"John" <JD@noSpam.com> wrote in message
news:c7**********@lust.ihug.co.nz... Hi everyone, I have a asp.net listbox (lstAvailable) that is populated
via as ADO DataSet.
[vbcode]
lstAvailable.DataSource = oDs
lstAvailable.DataTextField = oDs.Tables(0).Columns(0).ToString
lstAvailable.DataBind()
[/vbcode]
This works fine, but what I would like to do is for each item in the
listbox associated a new attribute to it. Given that each item in the list box
has a Text attribute and a Value attribute, I would like to add another
attribute called PersonID.
I tried this
lstAvailable.Attributes.Add("ContributorType",
oDs.Tables(0).Columns("PersonID").ToString)
But this adds the attribute to the listbox not to each individual item
in the list..
Thanks for any help in advance
Mark