Author: stevescotthome | Posted on: 6/25/2009 12:49:35 PM | Views : 344

Whats the best way to find and iterate through a group of controls on the page?
This is what i've been doing, but it seems wrong...
I want to grab all Children which are of type MyPage and do whatever...



foreach (Control c in Controls) { if (c is Panel) { foreach (Control p in c.Controls) { if (p is MyPage) { foreach (Control r in p.Controls) { if (r is ProgressBar) { ((ProgressBar)r).Text = this.UpdateProgress(); } } } } } }

Is this the right or wrong way to do this?


Thanks,
Steve

...

Go to the complete details ...