You can also put the corresponding attribute in the markup:
<asp:ImageButton ID="ImageButton1" runat="server" Text="Delete" ImageUrl="button.gif" AlternateText="Delete" OnClientClick='return confirm("Are you sure you want to delete this item?");'/>
As Jason mentions, I think trying to get confirmation before the dialog box can be tricky.
source
share