I’m trying to create an ascx control that can wrap content like a panel. I’m looking to do something like –
<%@ Register TagPrefix="FOO" TagName="Section" Src="CollapsibleSection.ascx" %>
<Foo:Section runat="server">
[ Section of asp.net webforms page ]
</Foo:Section>
It has been a while since I’ve done web forms and cannot remember if this is possible to do? While I could write a fully custom control, there are many advantages in my app if this is possible.
This is referred to as a templated control.
Here’s a simple tutorial explaining how this is done in both C# and VB.Net: How to: Create Templated ASP.NET User Controls
Quoted from MSDN (link above):