Adding To CheckBoxList

I always seem to be subclassing the standard .NET web controls and adding my own little features. Here is an enhancement that I made to CheckBoxList:
public String[] SelectedValues
        List<String> output = new List<String>();
        foreach (ListItem listItem in Items)
            if (listItem.Selected)
        return (output.ToArray());
Now that I have this method I can convert the CheckBoxList to a CSV like this:
String csv = String.Join(",", checkBoxList1.SelectedValues);


Popular posts from this blog

Yet once more into the breech (of altered programming logic)

Simple WP7 Mango App for Background Tasks, Toast, and Tiles: Code Explanation

How to convert SVG data to a Png Image file Using InkScape