I have code like this in Page_Load ()
btnMainDelete.Attributes.Add("onclick", "if(confirm('Are you sure you want to delete this?')){}else{return true}");
Basically, it confirms that before deletion (Yes / No). If so, delete the entry, and if not, do nothing.
For btnMainDelete, I put it like this:
<asp:Button ID="btnMainDelete" runat="server" Text="Delete" OnClick="btnMainDelete_Click" />
Now the problem is that I click "Yes" or "No" always performs btnMainDelete_Click on the server side? I must have something missing here.
thanks
source share