How to show the delete confirmation dialog box in asp.net

asp.net

Solution

You can also place the appropriate attribute within 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 validation prior to the dialog box could be tricky.

Problem

In asp button click event, We have to validate the data entered in UI and has to ask the confirmation before save the changes. How can i do that in asp.net web application?

Original source