Friday, July 27, 2012

Get checkboxlist selecte items in a string with comma seprated

this is code to get  selected items in checkbox list as a string separated with comma or any delimeter you want to use like |(Pipe singn)

var selectedValues = (from item in chbBroadType.Items.Cast() where item.Selected select item.Value).ToArray();
var selectedValuesJoined = string.Join(",", selectedValues);

No comments:

Post a Comment