public string[] selected()
{
string[] selecteditems = new string[chbindustry.Items.Count];
for (int i = 0; i < chbindustry.Items.Count-1; i++)
{
if (chbindustry.Items[i].Selected)
{
selecteditems[i] = chbindustry.Items[i].Text.ToString();
//string Va = string.Empty;
//Va = chbindustry.Items[i].Text.ToString();
// selecteditems[i] = Va;
}
}
return selecteditems;
}
In this code I want to add checkboxlist selected items to string array "selecteditems[i]" here using "selecteditems[i]" I need to bind in this code and show to only selected items
foreach (string s in subdirectoryEntries)
{
DirectoryInfo d = new DirectoryInfo(s);
for (int i = 1; i <= d.GetFiles().Length / 3; i++)
{
selected();
Page.ClientScript.RegisterArrayDeclaration("ImgPaths", "'" + "BusinessCards/" + s.Remove(0, s.LastIndexOf('\\') + 1) + "/" + i + ".jpg'");
Page.ClientScript.RegisterArrayDeclaration("refs", "'" + "DesignBCs.aspx?img=BusinessCards/" + s.Remove(0, s.LastIndexOf('\\') + 1) + "/" + i + "&Side=2'");
}
}