I have a webforms app that is hosting a silverlight project. The silverlight project makes a call to JavaScript on its host page. This JavaScript does a few bits and then clicks a button on the host page. This causes a postback, the response to which is a file, resulting in the user seeing the browsers file download window.
The creation of the file can take quite a bit of time and what I've discovered is that if the user requests that the file is generated, gets bored of waiting and presses refresh in the browser, the silverlight app will not load until the original postback (caused by the JavaScript call) has completed.
What I'd like to do provide a mechanism to abandon the file generation request, I don't care if it keeps going on the server, and currently I'm just interested in giving the user back their application.
How might I go about canceling a synchronous postback from JavaScript?