comma separated list


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public string Collection
  2. {
  3. get
  4. {
  5. List<String> sb = new List<String>();
  6.  
  7. foreach (ListItem cBox in Collections.Items)
  8. {
  9. if (cBox.Selected)
  10. {
  11. sb.Add(cBox.Value);
  12. }
  13. }
  14.  
  15. return string.Join(",", sb.ToArray());
  16. }
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.