I ran into an interesting problem while trying to clone a template bar in my ajax tabclainer control.
The idea is that I have a user control on the first tab that lists some things, and to add a new thing that you click on a new button in a custom control that triggers an event on the control / page containing the tab container This control / page then clones the hidden tab and adds the clone to the tabcontainer.
with this markup, I get what I need, starting with the first tab (containing the list) and any subsequent tabs (with a hidden tab template ready for cloning) ...
<asp:TabContainer ID="TabContainer1" runat="server">
<asp:TabPanel ID="ui_pnl1" HeaderText="My Panel" runat="server">
<ContentTemplate>
<cc1:myListOfThings ID="list" runat="server" OnMyEvent="CreateTabFromTemplate" />
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TemplatePanel" runat="server" Visible="false">
<HeaderTemplate>
<span>Hello World</span><asp:LinkButton ID="ui_btnRemove" runat="server" Text="x" />
</HeaderTemplate>
<ContentTemplate>
Some content for my panel
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
, , "MyEvent", , , "CreateTabFromTemplate".
, , "TemplatePanel" .
:
protected void CreateTabFromTemplate(object sender, EventArgs e)
{
TabPanel newPanel = new TabPanel();
ui_tpNoteCreator.ContentTemplate.InstantiateIn(newPanel);
TabContainer1.Tabs.Add(newPanel);
TabContainer1.ActiveTab = newPanel;
}
... - ... tabpanels... , , , .
: http://forums.asp.net/t/1108611.aspx/1 , , , .
, ... - ?!?!
?