[英]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内的LinkButton
Use your ImageButton control instead of LinkButton. 使用您的ImageButton控件而不是LinkButton。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.