I'm making a CRUD with a GridView, but when i try to edit a row when using an UpdatePanel i have to double click it so it works instead of clicking it just once, but also when i double click it it causes my validators to show and also a postback(which i don't want). like this:
This is the design code of the button:
<asp:TemplateField>
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<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" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnDelete" />
</Triggers>
</asp:UpdatePanel>
</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>
EDIT:My question is looking for a slighlty different answer as i've already tried the answer from How to use update panel on button click asp. i want my button not having to double click so it doesn't do a postback & activates the validators.