Пример #1
0
        public Control LookForControl(string id)
        {
            if (Controls.Count == 0)
            {
                return(null);
            }

            return(ControlsSearcher.FindControl(Controls[0], id));
        }
Пример #2
0
 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;
         }
     }
 }