What is the function "test()" doing? And a better way, well my opinion anyways, would be to use two buttons, one pure HTML calling the block code, and one server side one with "display: none"...
have the user click the HTML button/image, call your block code, and if all is well, trigger the hidden asp:button's "click" event