AJAX Page Loading message
-
I have a AJAX web page that has a long running query on it (about 10 seconds). Once the page is loaded, clicking an update button on the page causes the UpdateProgress to trigger as intended, and let the user know something is happening. My question is, how do I trigger the UpdateProgress on the initial page load, when the user first goes to the page? It sits there for 10 seconds, and then finally displays. I want the UpdateProgress to display right away, and then display the results when they are ready. I have tried putting code into the Page_LoadComplete, but this hasnt worked. Any clues to point me to the right direction would be appreciated! Thanks
-
I have a AJAX web page that has a long running query on it (about 10 seconds). Once the page is loaded, clicking an update button on the page causes the UpdateProgress to trigger as intended, and let the user know something is happening. My question is, how do I trigger the UpdateProgress on the initial page load, when the user first goes to the page? It sits there for 10 seconds, and then finally displays. I want the UpdateProgress to display right away, and then display the results when they are ready. I have tried putting code into the Page_LoadComplete, but this hasnt worked. Any clues to point me to the right direction would be appreciated! Thanks
Is this long query part of an AJAX request or does it happen during the processing of the initial page load? If its not part of an AJAX request then you have no gurantee that the UpdateProgress will even be rednered on the client before the task finishes. FYI Page_LoadComplete is only relevant server-side and happends just before PreRender.
-
I have a AJAX web page that has a long running query on it (about 10 seconds). Once the page is loaded, clicking an update button on the page causes the UpdateProgress to trigger as intended, and let the user know something is happening. My question is, how do I trigger the UpdateProgress on the initial page load, when the user first goes to the page? It sits there for 10 seconds, and then finally displays. I want the UpdateProgress to display right away, and then display the results when they are ready. I have tried putting code into the Page_LoadComplete, but this hasnt worked. Any clues to point me to the right direction would be appreciated! Thanks
wormer90 wrote:
how do I trigger the UpdateProgress on the initial page load, when the user first goes to the page?
Trigger a body onload event.
wormer90 wrote:
I want the UpdateProgress to display right away, and then display the results when they are ready.
Set the third parameter of the XMLHTTPRequest.open method to true. Request.open("post", "http://" + location.host + /server-side-script.php + ",
true
); This will make the XMLHTTPRequest asynchronous. You will then receive control immediately after the request is issued and be able to post your update in progress message.Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
I have a AJAX web page that has a long running query on it (about 10 seconds). Once the page is loaded, clicking an update button on the page causes the UpdateProgress to trigger as intended, and let the user know something is happening. My question is, how do I trigger the UpdateProgress on the initial page load, when the user first goes to the page? It sits there for 10 seconds, and then finally displays. I want the UpdateProgress to display right away, and then display the results when they are ready. I have tried putting code into the Page_LoadComplete, but this hasnt worked. Any clues to point me to the right direction would be appreciated! Thanks
If I understand your problem correctly, you don't need AJAX to do this, just some tricky JavaScript. Let's say you have a page, Page1.aspx, that takes much time to load (for example because of it's size). The trick is to create another page which then "calls" the desired page. So the crucial part of 'Loader.aspx':
window.location.href = 'http://www.yoursite.com/Page1.aspx'; //should obviously be generated dynamically