Listview control is one of my favorite controls added in asp.net version 3.5. It provides easy way to implement view (list), update, insert and delete functionality. Using SQL Data Source or LINQ Data Source control, you can create a page that will display data from database in your desired format. It will also allow you to edit, insert or delete a record from the listview itself. And the good part is that you don't need to write any code. This may be disappointing to a hard core programmer like me. But again this saves lot of development time.
I used confirm function in the OnClientClick event of the ListView's delete button.The code to use this is given below. Please note that in the code I used LinkButton instead of auto generated Button. This is for usability purpose and the code works well with the Button also.
<asp:LinkButton ID="DeleteButton" runat="server" CommandName="Delete" ForeColor="Red" Text="Delete" OnClientClick="return confirm('Are you certain you want to delete?');" />
And the dialog box shown by this code is :