简体   繁体   English

在UpdatePanel'UpdatePanel3'中找不到触发器ID为'imgbtn_excel_gridout'的控件

[英]A control with ID 'imgbtn_excel_gridout' could not be found for the trigger in UpdatePanel 'UpdatePanel3'

I am using this code but this is not working.. 我正在使用此代码,但无法正常工作。

1. When I remove update panel from this code It will working but with update panel this code not working. 1.当我从此代码中删除更新面板时,它将起作用,但在更新面板中,此代码将不起作用。 2. I also use trigger for button to send asynchronous request . 2.我还使用按钮的触发器发送异步请求。

         <asp:GridView ID="GridView2" runat="server" ShowFooter="True" AutoGenerateColumns="False" 
             CellPadding="4" ForeColor="Black" AllowPaging="True" 
             onpageindexchanging="GridView2_PageIndexChanging" 
             onrowdatabound="GridView2_RowDataBound" 
             onselectedindexchanged="GridView2_SelectedIndexChanged" 
             DataKeyNames="id,date" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" 
                       BorderWidth="3px" CellSpacing="2" PageSize="5" GridLines="None">
             <Columns>
                <%-- <asp:BoundField DataField="date" HeaderText="DATE" DataFormatString="{0:MM/dd/yy}">
                --%>
                 <asp:BoundField DataField="Id" HeaderText="REF. ID">
                 <ItemStyle BackColor="#33CC33" BorderColor="Maroon" Font-Bold="True" 
                     Font-Italic="True" ForeColor="#CC3300" />
                 </asp:BoundField>
                 <asp:BoundField DataField="Name" HeaderText="AUTHO. NAME" />
                 <asp:BoundField DataField="ItemType" HeaderText="ITEM TYPE">
                 <HeaderStyle Width="100px" />
                 </asp:BoundField>
                 <asp:BoundField DataField="Quantity" HeaderText="QUANTITY">
                 <HeaderStyle Width="130px" />
                 </asp:BoundField>
                 <asp:BoundField DataField="Brand" HeaderText="BRAND" />
                 <asp:BoundField DataField="SubType" HeaderText="SUB TYPE">
                 <HeaderStyle Width="100px" />
                 </asp:BoundField>
                 <asp:BoundField DataField="Date" HeaderText="DATE"  
                     DataFormatString="{0:yyyy-MM-dd HH:mm:ss}">

                 <HeaderStyle Width="100px" />
                 </asp:BoundField>
                     <asp:TemplateField SortExpression="QuantityInPiece" HeaderText="Quantity In Piece" >
                     <ItemTemplate > <asp:Label ID="lblId" runat="server" Text='<%# Bind("QuantityInPiece") %>'></asp:Label> </ItemTemplate>
                       <FooterTemplate> 
                             <asp:ImageButton ID="imgbtn_excel_gridout" runat="server" 
                                 ImageUrl="~/images/excel.jpg" Width="20px" Height="15px" 
                                 onclick="imgbtn_excel_gridout_Click">
                         </asp:ImageButton>
                         </FooterTemplate> 
                     </asp:TemplateField>
             </Columns>
             <FooterStyle BackColor="#CCCCCC" BorderStyle="Solid" />
             <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
             <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
             <RowStyle BackColor="White" />
             <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
             <SortedAscendingCellStyle BackColor="#F1F1F1" />
             <SortedAscendingHeaderStyle BackColor="#808080" />
             <SortedDescendingCellStyle BackColor="#CAC9C9" />
             <SortedDescendingHeaderStyle BackColor="#383838" />

             <SortedAscendingCellStyle BackColor="#E9E7E2"></SortedAscendingCellStyle>

             <SortedAscendingHeaderStyle BackColor="#506C8C"></SortedAscendingHeaderStyle>

             <SortedDescendingCellStyle BackColor="#FFFDF8"></SortedDescendingCellStyle>

             <SortedDescendingHeaderStyle BackColor="#6F8DAE"></SortedDescendingHeaderStyle>
         </asp:GridView>

                       <br />
       </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="imgbtn_excel_gridout" />
    </Triggers>
</asp:UpdatePanel>

You may try the approach being done here: 您可以尝试此处执行的方法:

ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview ASP.NET-将UpdatePanel触发器添加到gridview内的LinkBut​​ton

Use your ImageButton control instead of LinkButton. 使用您的ImageButton控件而不是LinkBut​​ton。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 UpdatePanel 中找不到触发器的 ID 控件 - A control with ID could not be found for the trigger in UpdatePanel 在UpdatePanel&#39;pnlUpdate&#39;中找不到触发器ID为&#39;btnUpload&#39;的控件 - A control with ID 'btnUpload' could not be found for the trigger in UpdatePanel 'pnlUpdate' UpdatePanel触发器错误。无法在UpdatePanel中的触发器的关联控件上找到事件 - UpdatePanel Trigger Error. Could not find an event on associated control for the trigger in UpdatePanel 为什么在更新面板中找不到控件 - Why is a control not found in an updatepanel 为什么我收到此错误,在UpdatePanel中找不到触发器的ControlID? - Why I am getting this error ,ControlID could not be found for the trigger in UpdatePanel? 使用第二个UpdatePanel的gridview中的LinkBut​​ton从第一个UpdatePanel更新文本框。 无法找到控制权 - Update textbox from 1st UpdatePanel using LinkButton from 2nd UpdatePanel's gridview. Control could not be found 如何从外部使用触发器控件更新UpdatePanel - How to update an UpdatePanel with a trigger control from outside of it UpdatePanel触发器:找不到名为“OnRowCommand”的事件 - UpdatePanel trigger: Could not find an event named 'OnRowCommand' 添加到“自定义控件”时触发UpdatePanel消失 - Trigger for UpdatePanel disappearing when added to a “custom control” ID 为“UpdatePanel1”的控件需要页面上的 ScriptManager - The control with ID 'UpdatePanel1' requires a ScriptManager on the page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM