473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Ajax.NET asynchronous call waits for first process to finish before executing second

Frinavale
9,735 Expert Mod 8TB
I have a peculiar problem...

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 message
2. 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
Jul 25 '08 #1
0 1536

Sign in to post your reply or Sign up for a free account.

Similar topics

48
by: Steve - DND | last post by:
I'm trying to determine if I need to make my application multi-threaded, or if it can be done with asynchronous programming. I realize that asynch calls do create a new thread in the background,...
3
by: Tony | last post by:
I've done a fair bit of searching on this, but I want to be certain about what I've found - so here goes with a long example and three questions: For clarity, let me give an example (a number of...
31
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
3
by: | last post by:
Is it possible to have just a multithreaded sub procedure? What I need is a timer time_elapsed event (2 sec interval) send params to a sub that is multithreaded. I have a COM component used to...
2
by: dmagliola | last post by:
Hello all, I'm experiencing a problem with ASP.Net for which I can't find a reasonable explanation, or any information. I'm currently developing an application that, through AJAX, asks the...
17
by: Arjen | last post by:
Hi, I want to reload 2 divs at one click. Ive tried: <a href = "javascript:void(0);"...
20
by: Bryan A | last post by:
Is there a way to add a timeout to this script so that it times out at a certain time. So it would be auto updating every 2seconds and it would timeout like after 100 seconds with a message?. ...
1
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.