How do I use the TabContainer control inside a FormView template?

Can I use TabContainer inside FormView template like so:   

            <ItemTemplate>
            <cc1:TabContainer ID="TabContainer1" runat="server">
                <cc1:TabPanel ID="Tab1" runat="server">
                    <HeaderTemplate>Tab One</HeaderTemplate>
                    <ContentTemplate>
                    ... bound fields  
                    </ContentTemplate>
                </cc1:TabPanel>
                <cc1:TabPanel ID="Tab2" runat="server">
                    <HeaderTemplate>Tab 2</HeaderTemplate>
                    <ContentTemplate>
                    ... bound fields    
                    </ContentTemplate>
                </cc1:TabPanel>
            </cc1:TabContainer>
        </ItemTemplate>

        <EditTemplate>
            <cc1:TabContainer ID="TabContainer1" runat="server">
                <cc1:TabPanel ID="Tab1" runat="server">
                    <HeaderTemplate>Tab One</HeaderTemplate>
                    <ContentTemplate>
                    ... bound fields  
                    </ContentTemplate>
                </cc1:TabPanel>
                <cc1:TabPanel ID="Tab2" runat="server">
                    <HeaderTemplate>Tab 2</HeaderTemplate>
                    <ContentTemplate>
                    ... bound fields    
                    </ContentTemplate>
                </cc1:TabPanel>
            </cc1:TabContainer>
        </EditTemplate>

      

Everything works fine for only one template at a time; for example, if the ItemTemplate works, then the EditTemplate won't. ASP.NET will complain about duplicate related field IDs.

Has anyone tried to do what I am trying to do?

Thank. - Gene

EDIT:

I don't think tab containers with the same ID are the issue here, as they are both inside separate template elements and only one template gets rendered at a time.

UPDATE:

I have not been able to find a solution and I think it is not possible. So, just go and use unique IDs. Being lazy, I wrote code to automate the dreaded naming process. I hope someone has a better answer. Anyway, I am too poor to afford to impose a bounty on her .; -)

0


source to share


2 answers


Haven't used the Tab container a lot, but you need to define a unique ID for each element on the page.



<cc1:TabContainer ID="TabContainer1" runat="server">
<cc1:TabContainer ID="TabContainer2" runat="server">

      

+1


source


I solved this the hard way by changing the names of the duplicate fields in each tab.



0


source







All Articles