Hi,
You can definitely create controls just like Panel and PlaceHolder - there's no magic to them! :)
If you look closely at Panel, even though it derives from WebControl, it has two very important meta-data attributes on it:
[
ParseChildren(false),
PersistChildren(true),
]
public class Panel : WebControl {
...
}
If you add these two attributes to your control, it should work just fine. If you derive from just Control (instead of WebControl) then you don't need those two attributes since they are the default anyway.
The full name of "ParseChildren" is "Parse Children As Properties" meaning that all content within the control tag will be considered properties (for example, the <Items> tag in a DropDownList>). In your case you don't want that - you want content to be treated as simple child controls.
PersistChildren means that at design-time (for example, in Visual Studio) you want ASP.net to persist the child controls for you automatically.
Thanks,
Eilon
Blog: http://weblogs.asp.net/LeftSlipper/