I noticed that it was actually YOU that asked the same question at aspfriends
(all those moons ago)
Even the great Sir Alex Lowe wrote
String myLabelString;
String myTextBoxString;
Control myControl;
foreach (myControl in Page.Controls)
{
switch (myControl.GetType().ToString())
{
case "System.Web.UI.TextBox" :
myTextBoxtring += ((TextBox)myControl).Text;
break;
case "System.Web.UI.Label" :
myLabelString += ((Label)myControl).Text;
break;
default :
'Do stuff with non Label/Textbox controls if you want
break;
}
}
which will basicaly do what I suggested to do ... my code avoids the need to
know the type, it simply prints the type.
Yet I cannot get any further than Mark ? I cannot get them to show up unless
they have been added programmatically.
So I take it all the code at the link must refer to controls that have been
added programmatically ????? does it ???
how did you fathom what was going on when you asked the original ?
Or have you (or anyone) been able to list controls that were added from the
toolbox ??? (i.e. in the designer).