Draw page before Page_Load() ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • davepkz@hotmail.com

    Draw page before Page_Load() ?


    I have a long operation I want to run when my page first appears, so I
    put it in Page_Load().

    However the browser doesn't draw the contents of the page until after
    Page_Load() is complete, though I wish it would.

    Am I putting my operation in the wrong place? Where do I put a process
    that I want run immediately after the page is first completely shown?

    thanks much
    dp

  • darrel

    #2
    Re: Draw page before Page_Load() ?

    However the browser doesn't draw the contents of the page until after
    Page_Load() is complete, though I wish it would.
    The browser draws the page once it receives all the HTML.
    Am I putting my operation in the wrong place? Where do I put a process
    that I want run immediately after the page is first completely shown?
    Once the page is completely shown, it's done with the server. The
    transaction is complete. By the time your browser starts getting the HTML,
    all your code has already been completely executed server-side.

    The only option off the top of my head would be to do all this via ajax.
    Load the page, then call the long process you are running via a javascript
    call on the page, which will then update the relevant portion via AJAX. Of
    course, using AJAX brings in a bunch of accessibility/usability issues that
    you'd want to weigh as well.

    -Darrel


    Comment

    • q

      #3
      Re: Draw page before Page_Load() ?

      What are we talking about? Please state your purpose.

      Also, do you mean client-side or server-side?




      davepkz@hotmail .com wrote:
      I have a long operation I want to run when my page first appears, so I
      put it in Page_Load().
      >
      However the browser doesn't draw the contents of the page until after
      Page_Load() is complete, though I wish it would.
      >
      Am I putting my operation in the wrong place? Where do I put a process
      that I want run immediately after the page is first completely shown?
      >
      thanks much
      dp

      Comment

      • davepkz@hotmail.com

        #4
        Re: Draw page before Page_Load() ?


        ok That makes sense. I'm obviously approaching this the wrong way.
        Here's the background:

        When the user selects to perform a long operation, I want to display a
        temp page that says something like "Please wait while we process your
        request," then go to the results when done.

        So my idea was:
        1. When user selects this option, Redirect to a page process.aspx that
        has the "Please Wait" message.
        2. Page_Load() for process.aspx first performs the long operation, then
        when done Redirects to the results.aspx.

        But of course this isn't working for the reasons you've explained.
        Presumably there is a more effective way to achieve this effect?
        dp



        darrel wrote:
        However the browser doesn't draw the contents of the page until after
        Page_Load() is complete, though I wish it would.
        >
        The browser draws the page once it receives all the HTML.
        >
        Am I putting my operation in the wrong place? Where do I put a process
        that I want run immediately after the page is first completely shown?
        >
        Once the page is completely shown, it's done with the server. The
        transaction is complete. By the time your browser starts getting the HTML,
        all your code has already been completely executed server-side.

        Comment

        Working...