Usually I did foreach loop ....
But why don't use the linq ??
So this way you can do it using linq.
You can see in the code how to get TextBoxes with values collection .
IEnumerable query = from p in this.Controls.OfType() where p.Text!=string.Empty select p ;
foreach (TextBox curTextBox in query)
{
//do what you need to do
}
No comments:
Post a Comment