hi there!
currently i've built a collapseControl which behaves similar to a label (associatedControlID) to control the collapse-state of a control.
following control i'd like to build:
i thought of something like:
put my already build collapsableControl and some other control (eg. panel) together to get a collapsableArea.
first try:
i tried to extend a panel and did the following:
this.Parent.Controls.Add(collapsableControl);
but this gave me: "not correct life cycle step", "can't modify", "nullReference", ... exceptions
so i gave it another try (which i believe the better choice, due to getting no tagKey):
i extended a placeholder and did the following:
this.Controls.Add(collapsableControl);
this.Controls.Add(collapsablePanel);
this caused other problems, like: i only want to set the text of the panel, the style of the panel, ...
wired!
do you have any solutions for this scenario?
edit:
i came up with another solution:
"CollapsableArea" is of type "Control", containing 2 extra private properties:
- "CollapsableControl"
- "Panel"
i thought it would be enough, to redirect the getter of the CollapsableArea.Controls to CollapsableArea.Panel.Controls. in CollapsableArea.CreateChildControls() i instanciate and add the CollapsableControl and Panel to base.Controls and in CollapsableArea.RenderChildren() render those 2
my problems now: the CollapsableControl will get a clientID (without setting an ID) - the panel won't render CollapsableControl will fail (or passed out), if panel contains <% %>-tags
any suggestions?
edit: i fixed the behaviour of the missing ID - just set CollapsableControl.AssociatedControlID to Panel.ClientID... but - when putting <% %> in the panel, it won't get rendered??!!