Get values from the listbox using vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Renilkumar
    New Member
    • Mar 2007
    • 26

    Get values from the listbox using vb.net

    Hi,
    I am using .net 2.0. I have a .aspx page with vb.net as codebehind.

    My form has one dropdown, 2 listboxes with add & remove button. During pageload I am loading all the values from the db to dropdown and after pageload, If I select value from the dropdown will load the data into the first listbox.
    I can select 1 or multiple values in the listbox and click on Add button will copy the data from source listbox to destination.
    Now how do I get all the values in the listbox using vb.net code ?

    Note: NOT the selected value. But I need all the values in the second listbox.

    Thanks,
    Kanda.
  • malav123
    New Member
    • Feb 2008
    • 217

    #2
    Originally posted by Renilkumar
    Hi,
    I am using .net 2.0. I have a .aspx page with vb.net as codebehind.

    My form has one dropdown, 2 listboxes with add & remove button. During pageload I am loading all the values from the db to dropdown and after pageload, If I select value from the dropdown will load the data into the first listbox.
    I can select 1 or multiple values in the listbox and click on Add button will copy the data from source listbox to destination.
    Now how do I get all the values in the listbox using vb.net code ?

    Note: NOT the selected value. But I need all the values in the second listbox.

    Thanks,
    Kanda.
    You can use java script for listbox manipulation... by usign java script you can accomplish your task.........

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Originally posted by Renilkumar
      Hi,
      I am using .net 2.0. I have a .aspx page with vb.net as codebehind.

      My form has one dropdown, 2 listboxes with add & remove button. During pageload I am loading all the values from the db to dropdown and after pageload, If I select value from the dropdown will load the data into the first listbox.
      I can select 1 or multiple values in the listbox and click on Add button will copy the data from source listbox to destination.
      Now how do I get all the values in the listbox using vb.net code ?

      Note: NOT the selected value. But I need all the values in the second listbox.

      Thanks,
      Kanda.
      Hi Renikumar,

      Check out the ListBox Class and the article listed there on How to Determine the Selection in List Web Server Controls. Using these two sources I'm sure you'll find your answer.

      Cheers!

      -Frinny

      Comment

      • Renilkumar
        New Member
        • Mar 2007
        • 26

        #4
        It helped me..Thanks a lot.

        Comment

        Working...