473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Listbox Control Not Returning Selected Values

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
Nov 18 '05 #1
1 1826
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" <MS******@Cox.net> wrote in message
news:eO**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alex Stevens | last post by:
I'd already posted this in microsoft.public.dotnet.framework.windowsforms and microsoft.public.dotnet.framework.windowsforms.controls to no avail so apologies for the cross-posting. Hi, I'm...
8
by: Vipin Kedia | last post by:
Hi I have written a code for showing the list boxes as selected using a Listitem and the selected property of the items. Now I have 2 list boxes in my page. But it shows only the selected values...
1
by: Matthew Sajdera | last post by:
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...
4
by: Moe Sizlak | last post by:
Hi There, I am trying to return the value of a listbox control that is included as a user control, I can return the name of the control but I can't access the integer value of the selected item,...
4
by: Ron | last post by:
I've got a listbox that holds a list of groups. Users can select a group, hit the remove button and the group should be removed from the listbox. The only problem is that no matter which group you...
6
by: Janaka | last post by:
Help! I have two ListBox controls on my web form. The first one gets populated on entry with values from the DB. I then use JavaScript to copy options from this ListBox to my second one. (I...
5
by: =?Utf-8?B?QmlnU2Ft?= | last post by:
I've a ListBox with the Selection Mode set to Multiple. I want to use the Selected values as the WHERE Parameters in a SQL Data Source. If I set the SQL Data Source to use the Selected Value of the...
1
by: John | last post by:
Using Access 2007 I find that, on opening a form, a listbox control always displays one of the values in the list, even if no value has been selected. Thus, the first value in the list is...
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have a ListBox server control named "lb_dates" with a SelectionMode of "Multiple". The user can select multiple dates from the listbox. I have ObjectDataSource named "ods_rfq" with a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.