Adding values to a listbox
I want to add values to the items in a listbox.
I add the items on page_load:
lstbox.items.add(someItem)
Is there a way to add a value for that item?
So for an item it would display 'Some Guy' but the selected value would be his ID number like 1.
Thanks again.
Re: Adding values to a listbox
This should do it for you:
VB Code:
Dim liAdd As ListItem
liAdd = New ListItem
liAdd.Text = "Some Guy"
liAdd.Value = "1"
lstbox.Items.Add(liAdd)
Re: Adding values to a listbox
Beauty, thanks again for your help.