I'm trying to implement a custom panel control that would act as a naming container. So far here is so what I've done.
First this is my custom control, MyPanel...
[ToolboxData("<{0}:MyPanel runat=server></{0}:MyPanel>")]
public class MyPanel: Panel, INamingContainer
{
}
And I try using it like so:
<cc1:MyPanel ID="A" runat="server">
<asp:HyperLink ID="TestHyperLink" runat="server" />
</cc1:MyPanel>
<cc1:MyPanel ID="B" runat="server">
<asp:HyperLink ID="TestHyperLink" runat="server" />
</cc1:MyPanel>
Obviously it doesn't work, that would have been too easy. ASP.net still complains about there being 2 DocumentHyperLink:
The ID 'DocumentHyperLink' is already used by another control.
How am I supposed to approach this problem?
Thank you.