none
Unable to determine selection list from ListBox using SelectionMode="Multiple" RRS feed

  • Question

  • I am attempting to use a ListBox with SelectionMode="Multiple" in ASP.NET. When I load the page, the list appears as expected and I can select different items as normal. However, when I try to iterate through the items in the list and find only those items that are selected, I can only get the first one. How can I determine the other selected items? Do I have to submit the page and NOT use the postback to determine the list or is there something I need to do for selected items after the first during a post back?

     

    When we use our old page - in ASP Classic, using VBScript, it works perfectly. How could upgrading to the newest code for ASP take away such basic functionality?

    And before anyone bring it up (as I see it all over the place when other people ask this same question) there is no "SelectedItems" just "SelectedItem"; nothing appears to be a collection or list of items selected - I always get just the first item selected.

     

    Please help me out here - this is beyond frustrating and I would hate to have to create something of my own just to do this simple thing...

     

    Bryan W

    Monday, March 28, 2011 10:12 PM