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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top