Hello all,
So I have an ASP.NET grid view:
<asp:GridView ID="gvReferences" runat="server" AutoGenerateColumns="False" ShowHeader="False"
OnRowEditing="gvReferences_RowEditing"
OnRowDeleting="gvReferences_RowDeleting" onrowcreated="gvReferences_RowCreated">
<Columns>
<asp:TemplateField ItemStyle-Width="400px">
<ItemTemplate>
<asp:Label ID="lblId" Visible="false" runat="server" Text='<%# Eval("Id") %>' />
<asp:Label ID="lblAssociatedSpecies" runat="server" Text='<%# Eval("Text") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblKind" runat="server" Text='<%# Eval("Kind") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ButtonType="Button" DeleteText="delete" ShowDeleteButton="True"
ShowCancelButton="False" EditText="edit" ShowEditButton="True">
<ControlStyle Width="60px" />
</asp:CommandField>
</Columns>
</asp:GridView>
I'd like to attach some JavaScript to the Delete command button to ask for confirmation before a row is deleted.
Any ideas?