Asp – Using the same asp panel in multiple tabs

asp.netvb.net

In the Ajax toolkit you can use a Tab Container and add TabPanels to this.

I have some controls that I want to be able to use across all tabs and the tailor the tabs with other controls as neccessary.

My question is how do I reuse a panel on multiple tabs?
Essentially I after something like this

<TabContainer>
<tabPanel1>
<contentTemplate>
<pnl1></pnl1>
//other controls here 
</contentTemplate>
</tabPanel1>

<tabPanel2>
<contentTemplate>
<pnl1></pnl1>
//other controls here
</contentTemplate>
<tabPanel2>
</tabContainer>


<pnl1>
//some controls here
</pnl1>

Best Solution

Make the panel a user control and then drop the user control in each tab panel.

<TabContainer>
  <tabPanel1>
    <contentTemplate>
      <uc1:MyControl id="myControl" runat="server" />
    </contentTemplate>
  </tablPanel1>

  <tabPanel2>
    <contentTemplate>
      <uc1:MyControl id="myControl2" runat="server" />
    </contentTemplate>
  </tablPanel2>
</TabContainer>

<uc1:MyControl id="myControl3" runat="server" />
Related Question