tags:

views:

301

answers:

2

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?

+2  A: 

Similar to this question, and the answer is the same: http://stackoverflow.com/questions/1118295/confirm-message-in-asp-net

David Stratton
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?
subramani
It's a bit tougher if you want to validate and then ask the confirmation, especially if you need server side validation. It might be easier to just ask for confirmation prior to validation.
Jason Berkan
+1  A: 

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.

Dal