Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ListBox Control Not Returing Selected Values

Reply
Thread Tools

ListBox Control Not Returing Selected Values

 
 
Matthew Sajdera
Guest
Posts: n/a
 
      04-12-2004
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

 
Reply With Quote
 
 
 
 
Matthew Sajdera
Guest
Posts: n/a
 
      04-12-2004
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a class for returing DB results Darin Ginther Ruby 7 12-31-2008 03:43 PM
Webservice returing a zip file Isa Janfada ASP .Net Web Services 1 03-19-2007 08:00 AM
Listbox move multiple selected items to second listbox K B ASP .Net 2 01-08-2007 11:16 AM
find_by_sql returing a class and not an instance of a class? Tom Ruby 2 06-04-2006 01:26 AM
Listbox Control Not Returning Selected Values Matthew Sajdera ASP .Net 1 04-12-2004 09:10 PM



Advertisments