Working with groups of user controls...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have nineteen user controls that are named "user_" concatenated with
(0-18). How can I loop through and set the visibility property to false for
each one. I tried something like:

protected alss.controls.something user_0;
protected alss.controls.something user_1;
protected alss.controls.something user_2;
....

for (Int32 i = 0; i <= 18; i ++) {
UserControl objUser = (UserControl) Page.FindControl ("user_" + i.ToString);
objUser.Visibility = false;
}

Any ideas?
 
Could you be more vague and provide less details?

did it throw an exception or simply not make things hidden? Maybe you can
give us more code? clearly that isn't it since it'sVisible and not
Visibility...

Karl
 
Back
Top