Could not be found for the trigger in UpdatePanel

I'm having a problem refresing the data in a gridview which is contained within an update panel.

I keep getting the error
A control with ID 'GridIVRecs' could not be found for the trigger in UpdatePanel 'UpdatePanel7'.


Update Panel 1
<asp:UpdatePanel ID="upGVRecs" runat="server" UpdateMode="Conditional" ><ContentTemplate>

                        <asp:GridView ID="GridIVRecs" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#006666" BorderStyle="Dotted" BorderWidth="1px" CssClass="table table-hover table-condensed table-responsive" DataKeyNames="IVRECORDID,Type" DataSourceID="DSIVRecs" GridLines="None" OnRowDataBound="GridIVRecs_RowDataBound" OnSelectedIndexChanged="GridIVRecs_SelectedIndexChanged" PageSize="12">
                            <Columns>
                                <asp:BoundField DataField="IVRECORDID" HeaderText="IVRECORDID" InsertVisible="False" ReadOnly="True" SortExpression="IVRECORDID" />
                                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                                <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
                                <asp:BoundField DataField="Planned" DataFormatString="{0:dd/MM/yyy}" HeaderText="Planned" SortExpression="Planned" />
                                <asp:BoundField DataField="Actual" DataFormatString="{0:dd/MM/yyy}" HeaderText="Actual" SortExpression="Actual" />
                                <asp:CommandField ShowSelectButton="True" />
                            </Columns>
                            <SelectedRowStyle CssClass="success" />
                        </asp:GridView>

                          <asp:HiddenField ID="hdIVRecordID" runat="server" />

                          <asp:SqlDataSource ID="dsJustInserted" runat="server" ConnectionString="<%$ ConnectionStrings:IrisConnectionString %>" SelectCommand="GET_IQA" SelectCommandType="StoredProcedure">
                              <SelectParameters>
                                  <asp:SessionParameter Name="IVRECORDID" SessionField="insIVID" Type="Int32" />
                              </SelectParameters>
                        </asp:SqlDataSource>

                          <asp:Button ID="btnNewIV" runat="server" AccessKey="n" CssClass="btn-primary  btn-xxs" Text="New IV Record" OnClick="btnNewIV_Click" CausesValidation="False"  />
</ContentTemplate></asp:UpdatePanel>

Open in new window


Update Panel 2 With Trigger

<asp:UpdatePanel ID="UpdatePanel7" runat="server"  UpdateMode="Conditional">
                            <ContentTemplate>
                        <asp:Label ID="lbIVID" runat="server"></asp:Label>

                           <asp:Button ID="btnDefaults" CssClass="btn-info  btn-xxs"  AccessKey="q"  runat="server" OnClick="btnDefaults_Click" Text="Auto Complete" CausesValidation="False" />
                                 <table class="auto-style1" id="IVRecTbl" runat="server">
            <tr runat="server">
                <td runat="server" class="auto-style3">Qualification</td>
                <td runat="server">
                    <asp:DropDownList ID="ddlQualSchemeID" runat="server" AppendDataBoundItems="True"
                                            DataSourceID="DSQuals" DataTextField="TITLE" CssClass="selectpickedr" data-live-search="true"
                                            DataValueField="QUALSCHEMEID" >
                        <asp:ListItem Value="0">-Select-</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rqddlQualSchemeID" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="ddlQualSchemeID" ErrorMessage="You must select a qualification." Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">IQA Type</td>
                <td runat="server">
                    <asp:DropDownList ID="ddlIVType" runat="server" AppendDataBoundItems="True"
                                            DataSourceID="DSIVType" DataTextField="IVTYPE"
                                            DataValueField="IVTYPEID" >
                        <asp:ListItem Value="0">-Select-</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rqddlIVType" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="ddlIVType" ErrorMessage="You must select an IV Type." Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">Planned Date</td>
                <td runat="server">
                    <asp:TextBox ID="txtPlannedDate" runat="server" ></asp:TextBox>
                    <ajaxToolkit:CalendarExtender ID="txtPlannedDate_CalendarExtender" runat="server"
                                            Enabled="True" TargetControlID="txtPlannedDate"  Format="dd/MM/yyyy">
                    </ajaxToolkit:CalendarExtender>
                    <asp:RequiredFieldValidator ID="rqtxtPlannedDate" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="txtPlannedDate" ErrorMessage="You must choose a'Planned Date'. " Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">Actual Date</td>
                <td runat="server">
                    <asp:TextBox ID="txtActualDate" runat="server" 
                                            ></asp:TextBox>
                    <ajaxToolkit:CalendarExtender ID="txtActualDate_CalendarExtender" runat="server"
                                            Enabled="True" TargetControlID="txtActualDate"  Format="dd/MM/yyyy">
                    </ajaxToolkit:CalendarExtender>
                    <asp:RequiredFieldValidator ID="rqtxtActualDate" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="txtActualDate" ErrorMessage="You must choose a'Actual Date'." Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">Outcome</td>
                <td runat="server">
                    <asp:DropDownList ID="ddlOutcome" runat="server" AppendDataBoundItems="True"
                                     DataSourceID="DSIVOutcome" 
                                            DataTextField="IVOUTCOME" DataValueField="IVOUTCOMEID">
                        <asp:ListItem Value="0">-Select-</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rqddlOutcome" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="ddlOutcome" ErrorMessage="You must choose an 'Outcome'." Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">PDM</td>
                <td runat="server">
                    <asp:DropDownList ID="ddlAssessorID" runat="server" AppendDataBoundItems="True" 
                                            DataSourceID="DSAssessorList" DataTextField="PDM" DataValueField="ASSESSORID" data-live-search="true"
                                         >
                        <asp:ListItem Value="0">-Select-</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rqddlAssessorID" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="ddlAssessorID" ErrorMessage="Please chooose an assessor." Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">IQA Name </td>
                <td runat="server">
                    <asp:DropDownList ID="ddlIQAName" runat="server" AppendDataBoundItems="True" 
                                            DataSourceID="DSListStaff" DataTextField="STAFFNAME" DataValueField="STAFFID" data-live-search="true">
                        <asp:ListItem Value="0">-Select-</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rqddlIQAName" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="ddlIQAName" ErrorMessage="Who is the IQA?" Font-Size="Large" ForeColor="#990000" Text="*" />
                    <asp:TextBox ID="TextBox11" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" class="auto-style3">IQA Site</td>
                <td runat="server">
                    <asp:DropDownList ID="ddlIQASite" runat="server" AppendDataBoundItems="True" 
                                            DataSourceID="DSIVSite" DataTextField="IVSITE" DataValueField="IVSITEID"
                                      >
                        <asp:ListItem Value="0">-Select-</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rqddlIQASite" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="ddlIQASite" ErrorMessage="What site was the IQA conducted at?" Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
            <tr runat="server">
                <td class="auto-style3" runat="server">Date Completed </td>
                <td class="auto-style2" runat="server">
                    <ajaxToolkit:CalendarExtender ID="txtDateCompleted_CalendarExtender" runat="server"
                                            Enabled="True" TargetControlID="txtDateCompleted" Format="dd/MM/yyyy">
                    </ajaxToolkit:CalendarExtender>
                    <asp:TextBox ID="txtDateCompleted" runat="server" 
                                           ></asp:TextBox>
<asp:RequiredFieldValidator ID="rqtxtDateCompleted" runat="server" BorderStyle="Dotted" BorderWidth="1px" ControlToValidate="txtDateCompleted" ErrorMessage="Please choose a completion date." Font-Size="Large" ForeColor="#990000" Text="*" />
                </td>
            </tr>
        </table>
                        
                        <br />
        <p>
        <asp:Button ID="btnSaveIVRecord" CssClass="btn-success  btn-xxs" OnClick="btnSaveIVRecord_Click" AccessKey="s" runat="server" Text="Save Record" />
        </p>
        <p>
            &nbsp;</p>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Size="Medium" ForeColor="#990033" HeaderText="You must complete the following information before you can submit." />
                          <table id="tblrecordInserted" visible ="False" runat="server">
                            <tr runat="server">
                                <td runat="server">IV record Inserted.</td>
                            </tr>
                        </table></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="GridIVRecs" EventName="Click"  /></Triggers></asp:UpdatePanel>

Open in new window

EdAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lokesh B RDeveloperCommented:
Hi,

try this

<Triggers>
<asp:AsyncPostBackTrigger ControlID="GridIVRecs" EventName="GridIVRecs_SelectedIndexChanged" />
</Triggers>
EdAuthor Commented:
Thanks but that didn't work....I still get the error

A control with ID 'GridIVRecs' could not be found for the trigger in UpdatePanel 'UpdatePanel7'.
EdAuthor Commented:
I think it maybe something to do with the update panels being in different tab containers
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Lokesh B RDeveloperCommented:
Hi,

Yes, i think so that will be the problem.

So Keep the GridView in the same tab and try.
EdAuthor Commented:
Hi

I found the solution.  You have to reference the tabcontainername$tabpanelname before the control name.

Like this

 <asp:AsyncPostBackTrigger ControlID="tcIQA1$tpIQA$GridIVRecs"  />
                             <asp:AsyncPostBackTrigger ControlID="tcIQADetail$tpIQADETAIL1$btnDefaults"  />
                               <asp:AsyncPostBackTrigger ControlID="tcIQADetail$tpIQADETAIL1$btnSaveIVRecord"  />

Open in new window


All works perfectly now.

Thanks

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EdAuthor Commented:
You have to reference the tabcontainername$tabpanelname before the control name.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.