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
Post a Comment