May 22, 2013, 4:51 PM
[CLOSED] Child.AddTo or Parent.Items.Add
Hello,
This is a general question. When building dynamic controls, ParentComponent.Items.Add(ChildComponent) works during page load but not working when called from direct event. ChildComponent.AddTo(ParentComponent) works for both. Is there a best practice or pros/cons for deciding between two alternatives?
Note-1: All in code behind.
Note-2: ParentComponent is defined in the markup, ChildComponent's are dynamically created and added to parent from code behind.
I am asking this to decide the right strategy for refreshing those dynamic child components (tree panel menu etc.)
Thanks.
This is a general question. When building dynamic controls, ParentComponent.Items.Add(ChildComponent) works during page load but not working when called from direct event. ChildComponent.AddTo(ParentComponent) works for both. Is there a best practice or pros/cons for deciding between two alternatives?
Note-1: All in code behind.
Note-2: ParentComponent is defined in the markup, ChildComponent's are dynamically created and added to parent from code behind.
I am asking this to decide the right strategy for refreshing those dynamic child components (tree panel menu etc.)
Thanks.
Last edited by Daniil; May 23, 2013 at 9:58 AM.
Reason: [CLOSED]