One way is to use HTTP Handlers and AJAX with jQuery.
1. Initiate Server side request
$("#btnCreateInvoice").click(function() {
$.ajax({ type: "POST", url: "YourHttpHandler.ashx",
contentType: "text/html; charset=utf-8",
dataType: "html",
success: function(data) { start the block UI }
});
});
2. Polling
What next you need to do is to poll the server at 't' interval and get the status. For that we need to call a function at 't' interval that would initiate an AJAX call to a HTTPHandler to get the status.
$(function() {
setInterval(updateStatus, 't');
});
function updateStatus() {
$.ajax({ type: "POST", url: "GetStatusHandler.ashx",
contentType: "text/html; charset=utf-8",
dataType: "html",
success: function(data) { process 'data' here and update the block UI message box }
});
}
In your case here, the GetStatusHandler.ashx can return the complete innerHtml for status.
For eg on the first call it will return 'Loading First source...', then it might return:
Loding First source...
Loading Second source...
and so on.