I found how to do this.
I added this script:
// Get the instance of PageRequestManager.
var prm = Sys.WebForms.PageRequestManager.getInstance();
// Add initializeRequest and endRequest
prm.add_initializeRequest(prm_InitializeRequest);
prm.add_endRequest(prm_EndRequest);
// Called when async postback begins
function prm_InitializeRequest(sender, args) {
// get the divImage and set it to visible
var panelProg = $get('loader');
var el = $get(args._postBackElement.id);
panelProg.style.display = '';
panelProg.style.position = 'fixed';
panelProg.top = el.offsetTop;
panelProg.left = el.offsetLeft;
}
// Called when async postback ends
function prm_EndRequest(sender, args) {
// get the divImage and hide it again
var panelProg = $get('loader');
panelProg.style.display = 'none';
panelProg.style.position = '';
}
And I added a div like this:
<div id="loader" style="display:none;">
<div class="circle"></div>
<div class="circle1"></div>
</div>
And styled it with some css3 animations