Sorry if the title is not clear enough. I have about 20 Label and 20 TextBoxes in my asp.Net form and the Visible attribute for all of them is false.
I'm willing to change some of their Visible attributes to true, depending on a given number. How can I use those Labels and TextBoxes' IDs in a FOR loop?
I've named the Labels like this: Label1, Label2, Label3, etc.
p.s: The ParameterCount's value varies from 1 to 20.
for (int i = 0; i <= parameterCount; i++)
{
Label[i].Visible = True; //I know it's wrong, but something like this
}
Example 1: ParameterCount = 4
(Label1, Label2, Label3, Label4).Visible = True
Example2: Parameter Count=2
(Label1, Label2).Visible = True