C
Chris Kettenbach
Good morning, Does anyone happen to know if there's a way to make an array
of the selected items in an asp:ListBox? I know you can loop through and
check the selected property, my question is how do you know how large to
make your array without looping through the list twice.
I had like button_click(object sender, EventArgs e)
{
ListBox lb = (ListBox)Page.FindControl("myListBox");
foreach(ListItem li in lb.items)
{ if (li.Selected)
{ //some code here to populate the array with the li.value }
}
Thanks for any advice.
Chris
of the selected items in an asp:ListBox? I know you can loop through and
check the selected property, my question is how do you know how large to
make your array without looping through the list twice.
I had like button_click(object sender, EventArgs e)
{
ListBox lb = (ListBox)Page.FindControl("myListBox");
foreach(ListItem li in lb.items)
{ if (li.Selected)
{ //some code here to populate the array with the li.value }
}
Thanks for any advice.
Chris