How to get a reference to a control from its' string name in C#?
+7
A:
If the Control is nested, use Control.FindControl from the parent Control. Otherwise, you'll have to write your own FindControlRecursive
davogones
2009-01-30 04:31:56
Note: In collections of controls, the FindControl method will return a different instance of the control of that name. In ASP.NET, that control will have a unique name also. In other words, FindControlRecursive will return the 1st control of that name.
Greg Ogle
2009-01-30 04:45:17