Hi,
the attachments list is server side state.
There's 2 solution for it :
A. call a button.click() and let it postback, call the DeleteAllAttachments() at server side.
--
B. you can just hide the table ( Attachments1.GetItemsTable().ClientID ) , set a flag to a hidden field , and call the DeleteAllAttachments() at server side OnLoad event if the hidden field is setted.
Regards,
Terry