Background:
I have a function that I don't want the user to execute more than once while they are waiting for it to process; therefore, I disable all of the controls on the page via some JavaScript before the request is sent. This function takes some time to execute because it has to communicate with hardware that is rather slow. This slowness combined with a little bit of lag sometimes results in a Sys.WebForms.PageRequestManager TimeoutException. Since I disable all of the controls during this processing, and because this exception prevents the server responding to the browser, my web page becomes unusable.
To fix this problem I ended up writing a JavaScript function that enables the "Exit" button on the page and displays a message informing the user that there was a problem when ever a Ajax Exception occurs...(this has been implemented in a function that is attached to the EndRequest event for those of you who are curious).
So now my user has a way to exit the page when something goes wrong.
Scenario:
Consider the following Scenario
1. The user clicks the button that triggers the slow function to execute.
When this happens a time out exception is thrown, my JavaScript catches the exception, enables the Exit button and displays an error message2. The user clicks the exit button
When the user clicks the exit button, another time out exception is thrown.....
Debugging this problem I placed a break point after the slow function finishes executing and a break point in the PageLoad of the aspx page.
When I click the exit button in step 2, the PageLoad event does not occur until After the slow function (triggered in step 1) has finished executing.
Could someone please explain to me why the first function has to finish executing before the second request can be processed?
It makes no sense to me why we would be given the ability to preform asynchronous calls to the server if the server cannot handle more than one request from a web browser.
Thanks in advance,
-Frinny