foreach (Control ctl in this.Controls)
{
...
}
I found only label are in the Controls collection. How can I obtain the collection for all other server controls on the page like TextBox, DropDownList, ..., etc.Hey,
I do it by form, try:
foreach (Control ctrl in ((HtmlForm)this.FindControl("form1")).Controls)
{
}
Regardless, it doesn't bring back only labels, but other controls. Try converting them to the appropriate type before using them.
Brian
COOL! that works. Thank you Brian.
0 comments:
Post a Comment