An ajax tabcontrol in a InsertItemTemplate on formview bound to llblgendatatsource2

Posts   
 
    
like2175
User
Posts: 83
Joined: 27-Mar-2006
# Posted on: 27-Sep-2007 15:38:55   

I have added an AjaxControlToolkit Tab control to the InsertItemTemplate of a Formview. Wthe "insert" button is pressed nothing is written to the database. I am doing something wrong?

Placing bound controls with the EditItemTemplate works fine.

llblgenpro 2.0 Oracle 9.2.0.7 VB.NET 2005 AjaxControlToolkit downloaded today.

Graham



<form id="form1" runat="server">
      <asp:ScriptManager ID="sm1" runat="server">
      </asp:ScriptManager>
    

        <llblgenpro:LLBLGenProDataSource ID="dsPerson" runat="server" DataContainerType="EntityCollection"
      EntityCollectionTypeName="Fluor.PAF.DAL.CollectionClasses.PersonCollection, Fluor.PAF.DAL" EnablePaging="True" 
      >
          <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

          <asp:FormView ID="fvPerson" runat="server" DataKeyNames="PersonId" DataSourceID="dsPerson"
           AllowPaging="True" DefaultMode="Insert">
            <EditItemTemplate>
...
            </EditItemTemplate>
            <InsertItemTemplate>

              <cc1:TabContainer ID="TabContainer2" runat="server" ActiveTabIndex="0">
                <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
                  <ContentTemplate>
                  PersonId
              <asp:Label ID="Label9" runat="server" Text='<%# Bind("PersonId") %>'></asp:Label><br />
        
                   First name<asp:TextBox CssClass="ValueField" ID="editFirstnameLabel" runat="server" 
                    Text='<%# Bind("Firstname") %>'></asp:TextBox>
                     Last name<asp:TextBox CssClass="ValueField" ID="TextBox1" runat="server" 
                    Text='<%# Bind("Lastname") %>'></asp:TextBox>
                  </ContentTemplate>
                </cc1:TabPanel>
              </cc1:TabContainer><br />
              <br />            

              <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Insert"
                      Text="Insert">
                    </asp:LinkButton>
                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                      Text="Cancel">
                    </asp:LinkButton>
            </InsertItemTemplate>

The output window shows the following when I enable llblgen debugging

Method Enter: TransactionBase.CTor
:   Transaction name: SaveRecursively. Isolation level: ReadCommitted.
Method Exit: TransactionBase.CTor
Method Enter: EntityBase.Save(2)
Active Entity Description: 
    Entity: Fluor.PAF.DAL.EntityClasses.PersonEntity. ObjectID: 6da2c6b8-7cd4-456d-90ea-ff51411809fa
    PrimaryKey field: PersonId. Type: System.Int32. Value: <undefined value>
Method Enter: ObjectGraphUtils.DetermineActionQueues(6)
Active Entity Description: 
    Entity: Fluor.PAF.DAL.EntityClasses.PersonEntity. ObjectID: 6da2c6b8-7cd4-456d-90ea-ff51411809fa
    PrimaryKey field: PersonId. Type: System.Int32. Value: <undefined value>
Method Exit: ObjectGraphUtils.DetermineActionQueues(6)
Method Exit: EntityBase.Save(2): no entities to save.
Method Enter: TransactionBase.Commit
Method Enter: TransactionBase.Reset
Method Exit: TransactionBase.Reset
Method Exit: TransactionBase.Commit

PersonId is the PK for the table. If I remove the Ajax tab controls then a new record is created in the database.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 27-Sep-2007 16:05:09   

Please check the following link: http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=8049 Apparently, the FormView can't find controls inside the TabContainer, to databind them.