My app does a form.submit() that invokes an action that returns a FileResult (an attachment). Prior to submit I have javacript that puts up a "please wait" div. I need to clear it when the result is returned. For actions that return a response that writes the page, I use the window.onload event to clear the div, but that event doesn't fire when an attachment is returned.
It doesn't work to do something like form.submit();HidePleaseWait()
because submit is asynchronous. Is there some other event that fires when an attachment is returned? Or, is there some way to combine multiple ActionResult so that I could update the page in the same response?