/// <summary> /// Dynamically adds a new User Control to the page, resolving the /// dependencies manually. /// </summary> private void AddControls() { InjectedControl newControl = LoadControl("InjectedControl.ascx") as InjectedControl; Container.BuildUp(newControl); DynamicInjectedControl.Controls.Add(newControl); }
/// <summary> /// Dynamically adds a new User Control to the page, resolving the /// dependencies manually. /// </summary> private void AddControls() { InjectedControl newControl = this.LoadControl("InjectedControl.ascx") as InjectedControl; this.DynamicInjectedControl.Controls.Add(newControl); }