Function ReturnSelectedTexts(ByVal objControlName As Object) As String
'This function returns the selected texts of the multiselect listbox
Dim strSelectedTexts As String
Dim lstItem As ListItem
For Each lstItem In objControlName.items
If lstItem.Selected = True Then
strSelectedTexts = strSelectedTexts & lstItem.Text & ", "
End If
Next
strSelectedTexts = Trim(strSelectedTexts)
strSelectedTexts = Left(strSelectedTexts, Len(strSelectedTexts) - 1)
Return strSelectedTexts
End Function
'----Usage
lblSearchCriterias.Text = "Email verified: " & ReturnSelectedTexts(lstEmailVerified)
'--It will give the selected items as comma separated.
Cheers
Rajesh Sivaraman.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment