C# - Click delete button and show confirmation message

When you click Delete buttton the onclick handler will return false.... eg.
<asp:Button ID="DeleteButton" runat="server" Text="Delete" CommandArgument='<%# Eval("Id") %>' CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete this record?')"   />

if you use script you can use this in onclick event of the button:
var result = confirm("you want to delete this record?");

if (result==true) {

    //Do Somethig