Hi all
I have an UpdatePanel: uplVirtual_Work that contains a GridView: gvwVirtual_Work. The GridView has a TemplateField that contains an Image ButtonigbDelete_VW.
The function of the igbDelete_VW is delete a row from the the grid view gvwVirtual_Work.
<asp:UpdatePanel ID="uplVirualWork" runat="server"><ContentTemplate><asp:GridView runat="server" ID="gvwVirtual_Work" AutoGenerateColumns="False" ShowHeader="False"><Columns><asp:BoundField DataField="Sno" HeaderText="م" ItemStyle-Width="3%" ></asp:BoundField>
.........
.........
.........<asp:TemplateField ItemStyle-Width="4%" ItemStyle-HorizontalAlign="Center"><ItemTemplate><asp:ImageButton ID="igbDelete_VW" runat="server" ImageUrl="~/images/Del_Circle.png"
CommandName="igbDelete_V" CommandArgument="<%# CType(Container, GridViewRow).RowIndex%>" /></ItemTemplate></asp:TemplateField></Columns></asp:GridView></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="igbDelete_VW" EventName="Click" /></Triggers></asp:UpdatePanel>Protected Sub gvwVirtual_Work_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvwVirtual_Work.RowCommand
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
gvwVirtual_Work.DeleteRow(index)
End SubWhen I run the code I get the following Error:
Server Error in '/' Application.
A control with ID 'igbDelete_VW' could not be found for the trigger in UpdatePanel 'uplVirualWork'.
Description: An unhandled exception occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where it originated in the code.