Hi,
I'm very new to C# ... so I don't really know how to interpret potential solutions ... like the one below given below:
Not sure what the <string> bit means ... do I pass the name of the ListBox (which contains the collection I need to pass) ... or is this a new variable?
Thanks for any help ...
J
I'm very new to C# ... so I don't really know how to interpret potential solutions ... like the one below given below:
Not sure what the <string> bit means ... do I pass the name of the ListBox (which contains the collection I need to pass) ... or is this a new variable?
Code:
protected void SomeEvent(...)
{
//get selected values
List<string> selected = new List<string>();
foreach(ListItem item in myControl.Items)
{
if(item.selected)
{
selected.Add(item.Value);
}
}
//call function
MyClass c = new MyClass(...);
c.MyFunction(selected.ToArray());
}
Thanks for any help ...
J