Solved

Ajax Tab control within formview

Posted on 2008-10-07
6
871 Views
Last Modified: 2012-05-05
I had many fields within a formview.  I was able to use the same name for the textboxs, labels, etc in my edit template, insert template, item template.  

Now I would like to use a tab control within the formview.  I need a tab control in each template (edit, item, insert).  However, it won't let me create controls with the same name.  For instance, in the edit, item and insert form templates I want a field called "txtEmployee" in a tab panel in a tab control.  It says a definition already exists for txtEmployee.   Is there a way to do this?
0
Comment
Question by:weimha
  • 3
  • 3
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22663708
You would have to get each Tab control a unique ID.
0
 

Author Comment

by:weimha
ID: 22668358
I have attached my code below.  I gave the tab control a unique ID but it still doesn't work.

     <%-- In edittemplate--%>

            <cc1:TabContainer ID="TabContainer3" runat="server">

                <cc1:TabPanel runat="server" ID="TabPanel1" HeaderText="Employee">

                    <ContentTemplate>

                        <div class="ExpenseGroup">

                            <asp:Panel ID="Panel1" runat="server">

                                <div class="body">

                                    <div class="content">

                                        <div class="row">

                                            <span class="labelcolumn">Employee:</span> <span class="column">

                                                <asp:TextBox ID="txtEmployee" runat="server" Text='<%# Bind("Employee") %>' SkinID="txtNumberField" /></span>

                                        </div>

                                    </div>

                                </div>

                            </asp:Panel>

                        </div>

                    </ContentTemplate>

                </cc1:TabPanel>

            </cc1:TabContainer>

            

           <%-- in insert template--%>

              <cc1:TabContainer ID="TabContainer4" runat="server">

                <cc1:TabPanel runat="server" ID="TabPanel2" HeaderText="Employee">

                    <ContentTemplate>

                        <div class="ExpenseGroup">

                            <asp:Panel ID="Panel2" runat="server">

                                <div class="body">

                                    <div class="content">

                                        <div class="row">

                                            <span class="labelcolumn">Employee:</span> <span class="column">

                                                <asp:TextBox ID="txtEmployee" runat="server" Text='<%# Bind("Employee") %>' SkinID="txtNumberField" /></span>

                                        </div>

                                    </div>

                                </div>

                            </asp:Panel>

                        </div>

                    </ContentTemplate>

                </cc1:TabPanel>

            </cc1:TabContainer> 

            

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22675019
"but is still doesn't work" doesn't explain why it didn't work.  Please try to be as specific as you can about your current situation.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:weimha
ID: 22686185
Sorry.  "still doesn't work" meaning I get the same error I was getting before (described in the qustion).
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 22686464
You said you have the Tab control unique IDs, but the exception is that the TextBox controls have the same ID.  No control can have the same ID.
0
 

Author Comment

by:weimha
ID: 22787732
Okay,  thanks.  I have decided not to use the formview.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now