asp.net - How to kill a javascript async call to a .net webservice? -


My javascript code is calling an asp.net webservice, so I have to call the webservice in this way:

MyWebservice.GetData (Ultimate, Response, Response Timeout, Response Error);

When the webservice returns the data, then the answer-protected method is called.

Although sometimes the user can navigate to another URL before the webservice call actually comes back, in such a scenario, Firefox says an error, 'An error occurred in the Orsysibube request server Method gatedown failed '

So my question is how can I kill async calls when a user navigates to another page or does another request for the webservice? I know in a general XMLHttpRequest that I could say the Abort method, but it is not sure how it works with the webservice proxy above.

A good practice will keep your normal tasks in a common place, accessible from all your pages. Could.

This will include the OnError function. This way you can safely refer to the same function from all your pages. If you need to provide custom error functionality, you can either override your work on this page, or add handlers to your normal function, and call when handed it.

A good place to keep such a common task will be a shared JavaScript file referenced within the root master page or from the root master page.

What's good about it, is it expected that your on error function logs something, so you can think of what fails and how often you You can design your app accordingly.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -