How to show asp.net delete confirmation dialog

In the asp button click event, we must check the data entered in the user interface and ask for confirmation before saving the changes.

How can I do this in an asp.net web application?

+3
source share
1 answer

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.

+4
source

Source: https://habr.com/ru/post/1718941/


All Articles