I'm trying to make a GriedView not to do PostBack everytime i click on the ImageButtons, i saw some examples that said that using an UpdatePanel should be enough, but i tried using it and couldn't make it Work entirely as just the ImageButton "btnUpdate" didn't work not even with triggers to enable the postback. In Resume: -btnEdit = Should not do PostBack.(i managed to do it) -btnDelete = Should not do PostBack.(i managed to do it) -btnUpdate = Should do PostBack(i don't know how to do this) -btnCancel = Should not do PostBack.(i managed to do it)
This is the GridView i'm using:
<asp:GridView EmptyDataText="No hay registros en la base de datos!" ID="gvImages" runat="server" DataKeyNames="idcountry" AutoGenerateColumns="false" Height="300px" OnRowEditing="gvImages_RowEditing"
OnRowCancelingEdit="gvImages_RowCancelingEdit" OnRowUpdating="gvImages_RowUpdating" OnRowDeleting="gvImages_RowDeleting" AllowPaging="true" OnPreRender="gvImages_PreRender" PageSize="6"
OnPageIndexChanging="gvImages_PageIndexChanging">
<Columns>
<asp:BoundField DataField="idcountry" HeaderText="ID" ReadOnly="true" />
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("FilePath") %>' Height="300" Width="300" />
</ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="FileUpload2" runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="btnEdit" CausesValidation="false" CssClass="btnOPTIONS" runat="server" ImageUrl="~/imgBTN/edit.png" Width="30px" Height="30px" ToolTip="Edit" CommandName="Edit" />
<asp:ImageButton ID="btnDelete" CausesValidation="false" runat="server" ImageUrl="~/imgBTN/delete.png" Width="30px" Height="30px" ToolTip="Delete" CommandName="Delete" />
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="btnUpdate" CausesValidation="false" CssClass="btnOPTIONS" runat="server" ImageUrl="~/imgBTN/save.png" Width="30px" Height="30px" ToolTip="Update" CommandName="Update" />
<asp:ImageButton ID="btnCancel" CausesValidation="false" runat="server" ImageUrl="~/imgBTN/cancel.png" Width="30px" Height="30px" ToolTip="Cancel" CommandName="Cancel" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>