Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting Multiple Selected Values From Listbox control

0 views
Skip to first unread message

SamIam

unread,
Feb 19, 2003, 8:48:27 PM2/19/03
to
I am busy looking getting values of a Listbox control with
SelectionMode="Multiple". So far I am having to do this:
(selProductID=ListBox)
StringBuilder productID = new StringBuilder();

for(i = 0; i < selProductID.Items.Count; i++)

{

if(selProductID.Items[i].Selected == true)

{

productID.Append(selProductID.Items[i].Value + ",");

}

}

I need to get a comma separated list of the values. Surely there must be a
better way? Before in ASP you could just say Request("selProductID") and you
would get a list of all the values that had been selected.

Cheers,

Sam I Am


Sonali.NET[MVP]

unread,
Feb 19, 2003, 10:06:19 PM2/19/03
to
Hi
 
Sending the URL os sample code which has selction of values from listbox
you modify it according to ur requirements
 
Sushila
.NET MVP
 
0 new messages