public Control LookForControl(string id) { if (Controls.Count == 0) { return(null); } return(ControlsSearcher.FindControl(Controls[0], id)); }
protected void BindMemberControls(Control container) { foreach (TemplateElementAttribute element in AttributeSearcher.GetMemberAttributes <TemplateElementAttribute>(this.GetType(), false)) { Control control = ControlsSearcher.FindControl(container, element.ID); if (control == null && !element.CanBeNull) { throw new InvalidOperationException(String.Format("Element {0} not found in parent control {1}", element.ID, control.ID)); } else { element[this] = control; } } }