I have a page and have a ListBox which some filenames on the list. I have a few Labels (id: LabelFileName1, 2, 3,.. and set as invisiable ). I have button and I want to do the selection from the ListBox to pick up some file names and click the button and
Lablesassociated with only the files were selected will be visiable and display the filename as the Label text.
my statement in C# like:
int[] index = ListBox1.GetSelectedIndices();
for (int i = 0; i < index.Length; i++)
{
Label fileName = (Label)Page.FindControl("LabelFileName" + i.ToString());
LabelFileName1.Visible = true;
fileName.Text = ListBox1.Items[index[i]].ToString();
}
Labels are supposed to be visiable and file should be shown as Text, but it did not work. Any comments? Thanks.
Go to the complete details ...