Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show all items in listbox in div tag

Status
Not open for further replies.

clanm

Programmer
Dec 26, 2005
237
US
hello!

I need to show all the listbox items in a div tag in order to build an SQL statement we're going to use for webservices.

I can show the count of the items in this listbox, but can't seem to get exactly the syntax to print each to a div tag.
Below is what I've got so far (wrong of course) in the Page_Load event:

divSI.InnerHtml = ""
Dim i As Integer
For i = 0 To ListBox2.Items.Count - 1
divSI.InnerHtml = ListBox2.Items.Add()
Next

Thanks!
 
got it with:

divSI.InnerHtml = ""
Dim i As Integer
For i = 0 To ListBox2.Items.Count - 1
divSI.InnerHtml += ListBox2.Items(i).Value
Next


Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top