views:

1619

answers:

3

Is it possible to use a TabContainer inside a templated FormView 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 view at a time; for example if ItemTemplate works then EditTemplate won't. ASP.NET will complain about duplicate bound field IDs.

Has anybody tried doing what I'm trying to do?

Thanks.- Gene

EDIT :

I don't think the tab containers with the same IDs is the issue here since they are both inside separate Template elements and only one Template gets rendered at a time.

UPDATE:

I didn't manage to find a solution, and I think it's not possible. So, just moved on and use unique IDs. Being lazy, I wrote some code to automate the dreaded naming process. I hope someone out there has a better answer to share. Anyway, I'm too poor to afford to put a bounty on it. ;-)

+1  A: 

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

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

Did you ever find the solution to this. I"m having the same problem and I don't want to rename all my controls

A: 

I solved this the hard way, by, changing the duplicate field names in each of the tabs.

jh