I\'m trying to get a control by name. I wrote the following code:
public Control GetControlByName(string name) { Control currentControl; for(int i
Just use the Controls collection Find method:
var aoControls = this.Controls.Find("MyControlName", true); if ((aoControls != null) && (aoControls.Length != 0)) { Control foundControl = aoControls[0]; }