Search code examples
c#asp.netvisual-studiocontrolsvisual-web-developer

How to get a reference to a control from its' string name in C#


How to get a reference to a control from its' string name in C#?


Solution

  • Page.FindControl

    If the Control is nested, use Control.FindControl from the parent Control. Otherwise, you'll have to write your own FindControlRecursive