Good afternoon programmers,
I have a webPage that contains two ListBoxes. When the user selects a ListBox item and clicks a button, the selected item is moved to the other ListBox. The ListBox.SelectedItem sometimes returns an item that was not selected and hence the wrong item is moved. On the page_load event the List box is filled programmatically. Here is the code for the button click event.
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles btnAdd.Click
Dim LI As ListItem = lbActive.SelectedItem
If LI Is Nothing Then Exit Sub
lbScramble.Items.Add(LI)
lbScramble.ClearSelection()
lbActive.Items.Remove(LI)
End Sub
I would appreciate your assistance; what am I doing wrong?
...
Go to the complete details ...