I’m interested in providing a general “I’m making an ajax call” notification … similar to how most of google’s services have a little red loading notification when it’s busy making a call. Is there a way of globally tapping into some event that I can use to show/hide that notification if there is an active call?
We’re not using the jQuery ajax apis, we’re using the MVC Ajax stuff … such as Ajax.BeginForm, or Ajax.ActionLink.
I’m not sure why the previous answer was accepted, but you can just use the LoadingElementId parameter in your AjaxOptions, by specifying an ID of an element in your page which has its display CSS property set to none.
MVC will do the rest of the work for you: when the request initiates, the DIV will be shown, and once it completes – hidden again. All you have to do is style the box (position it, provide ‘loading’ image, etc.).