need help to resolve concatenation error

  • Thread starter Thread starter TJS
  • Start date Start date
T

TJS

getting this error when retrieving selected items from a listbox:
----------------------------------------------------------------------------
---
BC30452: Operator '&' is not defined for types 'String' and
'System.Web.UI.WebControls.ListItem'.

for this code:
----------------------
Dim item As ListItem
Dim strList As String

For each item in StudyList.items
If item.selected then
strlist &= "<li>" & item 'fails here
End if
Next
 
The following line of code should work:

strlist = strlist & "<li>"

Hope this helps.

~ Celia ~
 
Back
Top