ASP.NET ListBox: Display both text & value? -


i have listbox on aspx page.

i'd display both text , associated values (not index). if add items this

dim listitem = new listitem("horse", "2") dim listitem = new listitem("dog", "3")  me.listbox.items.add(this) me.listbox.items.add(that) 

my listbox (please excuse list of artistic talent):

-------------- |2 horse     | |3 dog       | -------------- 

is there way this?

thanks,

jason

sure, why not combine text , value variable.

dim nextitem listitem = new listitem(string.concat("2", " ", "horse"), "2")  listbox.items.add(nextitem) 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -