WebForms link/image buttons are implemented by calling some JavaScript when you click them.
But you have added JavaScript
before that which unconditionally returns
true/false
, meaning that this code will never be called.
If you view the source of your page, you will see something that looks like:
onclick="javascript: return confirm(...); DoPostBack(...);"
Clearly the postback method can never be called.
Change your
OnClientClick
to only
return
if the user chooses to cancel:
deleteButton.OnClientClick = "if(!confirm(\"Are you sure?\")){return false;}";