When deleting an item in one of the ASP.NET grids, it would be nice to ask the user to confirm this is what they really meant to do. After all, it is very easy to click the mouse somewhere by accident. And what would be even nicer is if this confirmation took place on the client side (browser) instead of requiring yet another round trip to the server.
<asp:GridView ID="GridView1" runat="server" />
<asp:LinkButton ID="lnkDelete" runat="server"
Text="Delete" CommandArgument='<%# Bind("ItemID") %>'
OnClientClick="return confirm('Really delete this item?');">
Use of this article and any related source code or other files is governed
by the terms and conditions of