I came across this problem too.
This simple solution is probably enough:
- disable validation on your delete button (causesvalidation="false")
- add the 'onclick' event as normal using the Attributes property in your code behind file.
Setting causesvalidation to false means .net won't put in it's own 'onclick' method.
For my application, the delete doesn't require any validation (it just deletes the current item), and I think this will apply in the majority of situations. Hopefully those where some form of validation is required, maybe it's simple enough to write custom jscript.
I think it's a bit of a short-fall in the current webforms implementation.
Troy.