ListBoxes to display information when clicking the button
-
Hi I have 3 listboxes on my webpage,The first one which is ListBox2,when that page loads it display all the project members,It does that. That second and third ones when the user clicks the button it should display all the selected members in second listbox (ListBox1) and their Email address in the third listBox (ListBox3). This is my Code for the button click ,when the page loads it display all the project members but,when I chick the button ,it only display the selected members in the second Listbox(ListBox1)and doesn't display their email address in the third ListBix(ListBox3) **I WANT IT TO DISPLAY ALSO THE EMAIL ADDRESS IN THE THIRD LISTBOX,PLEASE HELP ME Protected Sub bntAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bntAdd.Click If ListBox2.SelectedIndex >= 0 Then Dim i As Integer For i = 0 To ListBox2.Items.Count - 1 If ListBox2.Items(i).Selected Then If Not lasset.Contains(ListBox2.Items(i)) Then lasset.Add(ListBox2.Items(i)) End If End If Next i For i = 0 To lasset.Count - 1 If Not ListBox1.Items.Contains(CType(lasset(i), ListItem)) Then ListBox1.Items.Add(CType(lasset(i), ListItem)) End If ListBox2.Items.Remove(CType(lasset(i), ListItem)) Next i Else 'ListBox2.SelectedIndex >= 0 Then Dim UserAdmin_Id As Integer Dim ds As New Data.DataSet Dim objdata As Businesslayer.TimeSheet = New Businesslayer.TimeSheet ds = objdata.GetMemberEmail(UserAdmin_Id) Dim Email As Integer For Email = 0 To ListBox2.Items.Count - 1 If ListBox2.Items(Email).Selected Then If Not lasset.Contains(ListBox2.Items(Email)) Then lasset.Add(ListBox2.Items(Email)) End If End If Next Email For Email = 0 To lasset.Count - 1 If Not ListBox3.Items.Contains(CType(lasset(Email), ListItem)) Then ListBox3.Items.Add(CType(lasset(Email), ListItem)) End If ListBox1.Items.Remove(CType(lasset(Email), ListItem)) Next Email End If End Sub