how to show confirmation box before inserting data in asp.net code behind

Posted by Shanky11 under ASP.NET on 11/3/2014 | Points: 10 | Views : 794 | Status : [Member] | Replies : 2
i have to check for a particular row if data exist then ask user do you want to over write it or quit>
if clicks yes go ahead to execute code
else
exit
do nothing




Responses

Posted by: Bandi on: 11/3/2014 [Member] [MVP] Platinum | Points: 25
Posted by: vishalneeraj-24503 on: 11/5/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi
Use can use Button OnClientClick client-side event to validate before saving.

Simply Write:-
<asp:Button ID="btn_save" runat="server" OnClientClick ="return confirm('Are you sure you want to Save changes?');" Text="Save" />
If you click Yes,tehn your code will be executed.and if you click No,then it will not.



Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response