Could not find control in update panel for trigger

In our asp.net c # application we use Ajax with control panel updates. In the panel, we put the export on the excel button inside the tab bar.

We also placed triggers after the content template ended. The code for the link is given below.

<asp:UpdatePanel ID="UpdatePanelPage" runat="server" UpdateMode="Conditional"> <ContentTemplate> <table id="tblMain" runat="server" cellpadding="0" cellspacing="0" width="100%"> <tr> <td> <asp:TabContainer ID="TabContainer1" runat="server" Width="100%"> <asp:TabPanel ID="tabCompanyName" runat="server"> <asp:Button ID="btnStateExportToExcel" runat="server" Text="Export To Excel" CssClass="button" OnClick="btnStateExportToExcel_Click" /> </asp:TabPanel> </asp:TabContainer> </td> </tr> </table> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="btnStateExportToExcel" /> </Triggers> </asp:UpdatePanel> 

Now, when we start the page, the following error will be displayed. "Control with identifier" btnStateExportToExcel "was not found for the trigger in UpdatePanel" UpdatePanelPage "". Any idea / suggestion will be very noticeable.

* According to the Google search results, the button is located on a tab, due to which the page could not find this control.

+8
triggers updatepanel
source share
1 answer

Your button is inside other controls. You must specify the container naming hierarchy for the update panel trigger. I think this will help you:

 <asp:PostBackTrigger ControlID="TabContainer1$tabCompanyName$btnStateExportToExcel" /> 
+19
source share

All Articles