I need to get the SelectedValue of each item selected in a
multi-selection listbox. I have the following code, but it
just returns me the SelectedValue of ONLY the first item
selected in the list:
Dim liGroup As ListItem
For Each liGroup In lstGroups.Items
If liGroup.Selected = True Then
blnSelected = True
Dim drGroupBridge As
dsACL.GroupBridgeRow = DsACL1.GroupBridge.NewGroupBridgeRow
drGroupBridge.UserID =
lstGroupUsers.SelectedValue
drGroupBridge.GroupID =
lstGroups.SelectedValue
DsACL1.GroupBridge.Rows.Add
(drGroupBridge)
End If
Next
It does cycle thru the code twice (because I have two
items selected), so it's performing the loop fine.
However, the following line above "drGroupBridge.GroupID =
lstGroups.SelectedValue", is the code I need to check for
the multiple SelectedValues from the lstGroups listbox.
It's only returning the first item selected in the list.
How can I accomplish this? What code am I missing???