It's easy to add this functionality to your web application however. All you need to do is to add handlers on Sys.Net.WebRequestManager to handle the invokeRequest and completedRequest events, like so:
Sys.Net.WebRequestManager.add_invokingRequest(onRequestInvoked);
Sys.Net.WebRequestManager.add_completedRequest(onRequestCompleted);
Make sure you do this after the ScriptManager control is loaded, otherwise you'll get an exception that Sys.Net doesn't exist. From there, your code can be as simple or as complicated as you like. Mine generally looks something like:
function onRequestInvoked() {
var stat = $get("status");
if (stat != null) stat.style.display = "block";
}
function onRequestCompleted() {
var stat = $get("status");
if (stat != null) stat.style.display = "none";
}
That's all there is to it!
0 comments:
Post a Comment