How to add a “confirm delete” option in ASP.Net Gridview?

This should do it.

I found it here: http://forums.asp.net/p/1331581/2678206.aspx

<asp:TemplateField ShowHeader="False">
    <ItemTemplate>
        <asp:ImageButton ID="DeleteButton" runat="server" ImageUrl="~/site/img/icons/cross.png"
                    CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete this event?');"
                    AlternateText="Delete" />               
    </ItemTemplate>
</asp:TemplateField>  

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)