ListBox Control Not Returing Selected Values

Discussion in 'ASP .Net Web Controls' started by Matthew Sajdera, Apr 12, 2004.

  1. All -

    I'm trying to capture the values in a multi-select ListBox and everything I've tried isn't working. Here is the code snippet that is trying to grab SELECTED values:

    // Build Copy To string
    foreach(ListItem itmCopyTo in lstCopyTo.Items)
    {
    if (itmCopyTo.Selected)
    strCopy.Append(itmCopyTo.Value + "@xyz.com;");
    }
    The foreach works fine, but the itmCopyTo.Selected always returns false.

    Thanks in Advance.

    - Matt
     
    Matthew Sajdera, Apr 12, 2004
    #1
    1. Advertising

  2. All -

    Thanks to anyone that looked at this. The code snippet is fine... it was a stupid PostBack issue that I wasn't paying attention to.

    Thanks,

    - Matt
    "Matthew Sajdera" <> wrote in message news:...
    All -

    I'm trying to capture the values in a multi-select ListBox and everything I've tried isn't working. Here is the code snippet that is trying to grab SELECTED values:

    // Build Copy To string
    foreach(ListItem itmCopyTo in lstCopyTo.Items)
    {
    if (itmCopyTo.Selected)
    strCopy.Append(itmCopyTo.Value + "@xyz.com;");
    }
    The foreach works fine, but the itmCopyTo.Selected always returns false.

    Thanks in Advance.

    - Matt
     
    Matthew Sajdera, Apr 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Sajdera

    Listbox Control Not Returning Selected Values

    Matthew Sajdera, Apr 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    422
    Matthew Sajdera
    Apr 12, 2004
  2. K B
    Replies:
    2
    Views:
    670
  3. Isa Janfada

    Webservice returing a zip file

    Isa Janfada, Mar 18, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    444
    Guest
    Mar 19, 2007
  4. Tom
    Replies:
    2
    Views:
    118
  5. Darin Ginther
    Replies:
    7
    Views:
    132
    Darin Ginther
    Dec 31, 2008
Loading...

Share This Page