locked
UpdatePanel with Ajax Took Kit TabPanel revisited RRS feed

  • Question

  • User1521304761 posted

    I know there are a number of posts regarding similar issues but I've reviewed them all and my markup and can't seem to find a resolution.  I have the markup below for one of my AjaxToolKit tabpanels.  I'm trying to add the updatepanel to allow it to postback rather than the entire page.  I've tried putting the updatepanel and triggers inside the contenttemplate, outside it but inside the Ajax tabpanel and now outside the Ajax tabpanel but continue to get the same errors each time.  All I'd like to do if have the gridview update on postback.  Those errors are...

    Element 'updatepanel' is not supported.

    Element 'triggers' is not supported.

    Element 'asyncpostbacktrigger' is not a known element.

    Also, after moving the updatepanel and triggers outside the Ajax tabpanel I'm now getting 'headertemplate' and 'contenttemplate' is not supported.

                  <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
                  </ajaxToolkit:ToolkitScriptManager>
                  <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" Height="800px"
                         BackColor="Gray" AutoPostBack="False" ScrollBars="Auto">
                        <updatepanel ID="dgvBomUpdate" runat="server" UpdateMode="Conditional">
                            <triggers>
                               <asp:asyncpostbacktrigger ControlID="btnPartAdd" EventName="Click" />
                            </triggers>
                        <ajaxToolkit:TabPanel ID="tab1" runat="server"
                                HeaderText="BOM" ScrollBars="Both" OnDemandMode="None">
                            <HeaderTemplate>
                                BOM
                            </HeaderTemplate>
    
                            <ContentTemplate>
                                <table class="style1">
                                    <tr>
                                        <td class="style11">
                                            <ajaxToolkit:ComboBox ID="cbxPartLookup" runat="server" 
                                                AutoCompleteMode="SuggestAppend" MaxLength="0">
                                            </ajaxToolkit:ComboBox>
                                        </td>
                                        <td class="style11">
                                            <asp:Button ID="btnPartAdd" runat="server" OnClick="btnPartAdd_click" 
                                                Text="Add Part" />
                                        </td>
                                    </tr>
                                </table>
                                <asp:GridView ID="dgvBOM" runat="server" AutoGenerateColumns="False" width="858px" CellPadding="4" ForeColor="#333333" GridLines="None">
                                <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Status" SortExpression="Status">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Status") %>' Width="35px"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Status") %>' Width="35px"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Part ID" SortExpression="Part ID">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PartNum") %>' Width="145px"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("PartNum") %>' Width="145px"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Description" SortExpression="Description">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PartDesc") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("PartDesc") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Cur Qty" SortExpression="Cur Qty">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("CurQty") %>' Width="35px"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label4" runat="server" Text='<%# Bind("CurQty") %>' Width="35px"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Cur Due" SortExpression="Cur Due">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("CurDue") %>' Width="55px"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("CurDue", "{0:d}") %>' Width="55px"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Qty Per" SortExpression="Qty Per">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("QtyPer") %>' Width="35px"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label6" runat="server" Text='<%# Bind("QtyPer") %>' Width="35px"></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:TemplateField>
                                        <asp:CommandField ShowEditButton="True" />
                                        <asp:CommandField ShowDeleteButton="True" />
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                 </asp:GridView>
                            </ContentTemplate>
                        </ajaxToolkit:TabPanel>
                        </UpdatePanel>

    Wednesday, July 9, 2014 11:55 AM

Answers

  • User459955333 posted
    <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" Height="800px"
                         BackColor="Gray" AutoPostBack="False" ScrollBars="Auto">
                        <updatepanel ID="dgvBomUpdate" runat="server" UpdateMode="Conditional">
                            <triggers>

    From your code i noticed .. u use <updatepanel im quite sure it should be <asp:UpdatePanel ... that's the first thing that comes to mind .. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 9, 2014 11:20 PM

All replies

  • User-1360095595 posted

    You're missing the contenttemplate of the updatepanel. You have to have that. 

    Wednesday, July 9, 2014 12:01 PM
  • User1521304761 posted

    Are you saying the updatepanel needs it's own contenttemplate?  Sorry, I'm not following what you're saying and I'm actually using the example http://msdn.microsoft.com/en-us/library/vstudio/bb386452%28v=vs.100%29.aspx as a guide.  It looks like they are putting wrapping the content template of the in the updatepanel which is one of the options I've tried, but got the same errors.  I then saw a similar thread on this site indicating the updatepanel needed to be outside the ajaxtoolkit; tabpanel.

    So is this what you mean?

                         <updatepanel ID="dgvBomUpdate" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                            <triggers>
                               <asp:asyncpostbacktrigger ControlID="btnPartAdd" EventName="Click" />
                            </triggers>
                            </ContentTemplate>
                           </updatepanel>

    Wednesday, July 9, 2014 12:37 PM
  • User-1360095595 posted

    That's right. The updatepanel has its own contenttemplate. The triggers section has to be outside. What you show above is wrong. 

    Refer the info here: http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx

    Edit: correct spelling. 

    Wednesday, July 9, 2014 12:44 PM
  • User1521304761 posted

    So I have tried it both your way and the example in the link after reviewing the information.  Regardless of where I put it I get the "Element is not supported" error.  Both for the updatepanel, contenttemplate and triggers.  I'm just at a loss as to what I could be missing.  If I remove the updatepanel and triggers then there is no error for the contenttemplate.  As soon as I add them anywhere the errors return.

    Wednesday, July 9, 2014 5:30 PM
  • User-1360095595 posted

    Try to put the entire tabcontainer and panels inside the contenttemplate of the updatepanel. 

    Wednesday, July 9, 2014 5:36 PM
  • User1521304761 posted

    So, that is about the only thing I haven't tried.  I'm certainly no expert by any stretch.  I'm just thinking that I shouldn't need to do that to use the update "panel". 

    My tabcontainer consists of three panels.  The reason I'm trying to get the updatepanel working is because currently everytime I make a change to one they all refresh taking longer than if i could just get the changed tab to refresh. 

    I guess I will give it a try tomorrow just to see if it works, although I'll only know if I'm still getting the errors not if it works since the behavior of the page would be the same with or without it.

    Wednesday, July 9, 2014 6:56 PM
  • User-1360095595 posted

    You should be aware that with an UpdatePanel, when a postback occurs, the server goes through the entire page lifecycle. So all the server code runs, as if you don't have an UpdatePanel. The only difference is in the rendering: only the content of the updatepanel is updated. That's it. 

    Wednesday, July 9, 2014 7:02 PM
  • User459955333 posted
    <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" Height="800px"
                         BackColor="Gray" AutoPostBack="False" ScrollBars="Auto">
                        <updatepanel ID="dgvBomUpdate" runat="server" UpdateMode="Conditional">
                            <triggers>

    From your code i noticed .. u use <updatepanel im quite sure it should be <asp:UpdatePanel ... that's the first thing that comes to mind .. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 9, 2014 11:20 PM