Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. AJAX Page Loading message

AJAX Page Loading message

Scheduled Pinned Locked Moved Web Development
questiondatabaseannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AaronM_NZ
    wrote on last edited by
    #1

    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

    B J S 3 Replies Last reply
    0
    • A AaronM_NZ

      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

      B Offline
      B Offline
      badgrs
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • A AaronM_NZ

        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

        J Offline
        J Offline
        JimmyRopes
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • A AaronM_NZ

          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

          S Offline
          S Offline
          szukuro
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups