Loading script.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Curious George

    #1

    Loading script.

    I have a page that takes about 10 seconds to load the first time it is run.

    I would like to first display a little animated gif telling the user that
    the page is loading.

    How do I do this with .NET?

    I used to create a loading layer at the top of the page. Flush the layer to
    the buffer.

    Then I set the loading layers visibility false (with JavaScript) and
    generate the page in another layer. Then flush the new HTML to the buffer.

    How would I do a like thing in .NET?

    George


  • Ignacio Machin

    #2
    Re: Loading script.

    Hi,

    There is nothing to be done in .net , just do the same old trick :)
    Create two layers, one with the loading ... message and the other with all
    the page the first visible and the latter not visible, on the OnLoad event
    of the Body tag invert the visibility of them and voila.


    Hope this help,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation

    "Curious George" <mu330__@hotmai l.nospam> wrote in message
    news:eqLxmY7eDH A.2408@TK2MSFTN GP09.phx.gbl...[color=blue]
    > I have a page that takes about 10 seconds to load the first time it is[/color]
    run.[color=blue]
    >
    > I would like to first display a little animated gif telling the user that
    > the page is loading.
    >
    > How do I do this with .NET?
    >
    > I used to create a loading layer at the top of the page. Flush the layer[/color]
    to[color=blue]
    > the buffer.
    >
    > Then I set the loading layers visibility false (with JavaScript) and
    > generate the page in another layer. Then flush the new HTML to the[/color]
    buffer.[color=blue]
    >
    > How would I do a like thing in .NET?
    >
    > George
    >
    >[/color]


    Comment

    • Curious George

      #3
      Re: Loading script.

      Do I create the loading layer outside of the body?

      Do I need to flush the buffer? When I tried to do it in .NET all layers
      rendered at the same time.


      "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
      news:O5xJ2l7eDH A.1872@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Hi,
      >
      > There is nothing to be done in .net , just do the same old trick :)
      > Create two layers, one with the loading ... message and the other with[/color]
      all[color=blue]
      > the page the first visible and the latter not visible, on the OnLoad event
      > of the Body tag invert the visibility of them and voila.
      >
      >
      > Hope this help,
      >
      > --
      > Ignacio Machin,
      > ignacio.machin AT dot.state.fl.us
      > Florida Department Of Transportation
      >
      > "Curious George" <mu330__@hotmai l.nospam> wrote in message
      > news:eqLxmY7eDH A.2408@TK2MSFTN GP09.phx.gbl...[color=green]
      > > I have a page that takes about 10 seconds to load the first time it is[/color]
      > run.[color=green]
      > >
      > > I would like to first display a little animated gif telling the user[/color][/color]
      that[color=blue][color=green]
      > > the page is loading.
      > >
      > > How do I do this with .NET?
      > >
      > > I used to create a loading layer at the top of the page. Flush the[/color][/color]
      layer[color=blue]
      > to[color=green]
      > > the buffer.
      > >
      > > Then I set the loading layers visibility false (with JavaScript) and
      > > generate the page in another layer. Then flush the new HTML to the[/color]
      > buffer.[color=green]
      > >
      > > How would I do a like thing in .NET?
      > >
      > > George
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Ignacio Machin

        #4
        Re: Loading script.

        Hi,

        See the code below, I havent tested it, I just write it in OE.

        This is the "normal" page:

        <body>
        <form>
        </form>
        </body>

        this is the new page struct:
        <script>
        function ShowPage()
        {
        documents.all["preloadlay er"].style.visibili ty = "hidden";
        documents.all["pagelayer"].style.visibili ty = "visible";
        }
        </script>

        <body onLoad ="ShowPage() ;">
        <div id="preloadlaye r" name="preloadla yer" visibility="vis ible:visible;">
        loading ...
        </div>
        <div id="pagelayer" id="pagelayer" style="visibili ty:hidden;">
        <form>
        </form>
        </div>
        </body>

        Hope this help,

        --
        Ignacio Machin,
        ignacio.machin AT dot.state.fl.us
        Florida Department Of Transportation

        "Curious George" <mu330__@hotmai l.nospam> wrote in message
        news:eJxygT8eDH A.556@TK2MSFTNG P11.phx.gbl...[color=blue]
        > Do I create the loading layer outside of the body?
        >
        > Do I need to flush the buffer? When I tried to do it in .NET all layers
        > rendered at the same time.
        >
        >
        > "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
        > news:O5xJ2l7eDH A.1872@TK2MSFTN GP09.phx.gbl...[color=green]
        > > Hi,
        > >
        > > There is nothing to be done in .net , just do the same old trick :)
        > > Create two layers, one with the loading ... message and the other with[/color]
        > all[color=green]
        > > the page the first visible and the latter not visible, on the OnLoad[/color][/color]
        event[color=blue][color=green]
        > > of the Body tag invert the visibility of them and voila.
        > >
        > >
        > > Hope this help,
        > >
        > > --
        > > Ignacio Machin,
        > > ignacio.machin AT dot.state.fl.us
        > > Florida Department Of Transportation
        > >
        > > "Curious George" <mu330__@hotmai l.nospam> wrote in message
        > > news:eqLxmY7eDH A.2408@TK2MSFTN GP09.phx.gbl...[color=darkred]
        > > > I have a page that takes about 10 seconds to load the first time it is[/color]
        > > run.[color=darkred]
        > > >
        > > > I would like to first display a little animated gif telling the user[/color][/color]
        > that[color=green][color=darkred]
        > > > the page is loading.
        > > >
        > > > How do I do this with .NET?
        > > >
        > > > I used to create a loading layer at the top of the page. Flush the[/color][/color]
        > layer[color=green]
        > > to[color=darkred]
        > > > the buffer.
        > > >
        > > > Then I set the loading layers visibility false (with JavaScript) and
        > > > generate the page in another layer. Then flush the new HTML to the[/color]
        > > buffer.[color=darkred]
        > > >
        > > > How would I do a like thing in .NET?
        > > >
        > > > George
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Curious George

          #5
          Re: Loading script.

          Ahh yes,

          The problem is that the whole page is seams to be buffered until everything
          is generated.

          So you will wait for 10 seconds with a white screen and then the loading
          layer will quickly flash before being made invisible and the main layer
          being made visible.

          I have set the buffer flag to false and tried to use Response.Flush in the
          script but to no avail.

          Any ideas?


          example code:

          Loading Report Dates...







          "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
          news:%23QQdmc8e DHA.1648@TK2MSF TNGP09.phx.gbl. ..[color=blue]
          > Hi,
          >
          > See the code below, I havent tested it, I just write it in OE.
          >
          > This is the "normal" page:
          >
          > <body>
          > <form>
          > </form>
          > </body>
          >
          > this is the new page struct:
          > <script>
          > function ShowPage()
          > {
          > documents.all["preloadlay er"].style.visibili ty = "hidden";
          > documents.all["pagelayer"].style.visibili ty = "visible";
          > }
          > </script>
          >
          > <body onLoad ="ShowPage() ;">
          > <div id="preloadlaye r" name="preloadla yer" visibility="vis ible:visible;">
          > loading ...
          > </div>
          > <div id="pagelayer" id="pagelayer" style="visibili ty:hidden;">
          > <form>
          > </form>
          > </div>
          > </body>
          >
          > Hope this help,
          >
          > --
          > Ignacio Machin,
          > ignacio.machin AT dot.state.fl.us
          > Florida Department Of Transportation
          >
          > "Curious George" <mu330__@hotmai l.nospam> wrote in message
          > news:eJxygT8eDH A.556@TK2MSFTNG P11.phx.gbl...[color=green]
          > > Do I create the loading layer outside of the body?
          > >
          > > Do I need to flush the buffer? When I tried to do it in .NET all layers
          > > rendered at the same time.
          > >
          > >
          > > "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
          > > news:O5xJ2l7eDH A.1872@TK2MSFTN GP09.phx.gbl...[color=darkred]
          > > > Hi,
          > > >
          > > > There is nothing to be done in .net , just do the same old trick :)
          > > > Create two layers, one with the loading ... message and the other[/color][/color][/color]
          with[color=blue][color=green]
          > > all[color=darkred]
          > > > the page the first visible and the latter not visible, on the OnLoad[/color][/color]
          > event[color=green][color=darkred]
          > > > of the Body tag invert the visibility of them and voila.
          > > >
          > > >
          > > > Hope this help,
          > > >
          > > > --
          > > > Ignacio Machin,
          > > > ignacio.machin AT dot.state.fl.us
          > > > Florida Department Of Transportation
          > > >
          > > > "Curious George" <mu330__@hotmai l.nospam> wrote in message
          > > > news:eqLxmY7eDH A.2408@TK2MSFTN GP09.phx.gbl...
          > > > > I have a page that takes about 10 seconds to load the first time it[/color][/color][/color]
          is[color=blue][color=green][color=darkred]
          > > > run.
          > > > >
          > > > > I would like to first display a little animated gif telling the user[/color]
          > > that[color=darkred]
          > > > > the page is loading.
          > > > >
          > > > > How do I do this with .NET?
          > > > >
          > > > > I used to create a loading layer at the top of the page. Flush the[/color]
          > > layer[color=darkred]
          > > > to
          > > > > the buffer.
          > > > >
          > > > > Then I set the loading layers visibility false (with JavaScript) and
          > > > > generate the page in another layer. Then flush the new HTML to the
          > > > buffer.
          > > > >
          > > > > How would I do a like thing in .NET?
          > > > >
          > > > > George
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Curious George

            #6
            Re: Loading script. (example)

            Sorry example would not render inline.


            "Curious George" <mu330__@hotmai l.nospam> wrote in message
            news:%23SSeCC9e DHA.2348@TK2MSF TNGP12.phx.gbl. ..[color=blue]
            > Ahh yes,
            >
            > The problem is that the whole page is seams to be buffered until[/color]
            everything[color=blue]
            > is generated.
            >
            > So you will wait for 10 seconds with a white screen and then the loading
            > layer will quickly flash before being made invisible and the main layer
            > being made visible.
            >
            > I have set the buffer flag to false and tried to use Response.Flush in the
            > script but to no avail.
            >
            > Any ideas?
            >
            >
            > example code:
            >
            > Loading Report Dates...
            >
            >
            >
            >
            >
            >
            >
            > "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
            > news:%23QQdmc8e DHA.1648@TK2MSF TNGP09.phx.gbl. ..[color=green]
            > > Hi,
            > >
            > > See the code below, I havent tested it, I just write it in OE.
            > >
            > > This is the "normal" page:
            > >
            > > <body>
            > > <form>
            > > </form>
            > > </body>
            > >
            > > this is the new page struct:
            > > <script>
            > > function ShowPage()
            > > {
            > > documents.all["preloadlay er"].style.visibili ty = "hidden";
            > > documents.all["pagelayer"].style.visibili ty = "visible";
            > > }
            > > </script>
            > >
            > > <body onLoad ="ShowPage() ;">
            > > <div id="preloadlaye r" name="preloadla yer"[/color][/color]
            visibility="vis ible:visible;">[color=blue][color=green]
            > > loading ...
            > > </div>
            > > <div id="pagelayer" id="pagelayer" style="visibili ty:hidden;">
            > > <form>
            > > </form>
            > > </div>
            > > </body>
            > >
            > > Hope this help,
            > >
            > > --
            > > Ignacio Machin,
            > > ignacio.machin AT dot.state.fl.us
            > > Florida Department Of Transportation
            > >
            > > "Curious George" <mu330__@hotmai l.nospam> wrote in message
            > > news:eJxygT8eDH A.556@TK2MSFTNG P11.phx.gbl...[color=darkred]
            > > > Do I create the loading layer outside of the body?
            > > >
            > > > Do I need to flush the buffer? When I tried to do it in .NET all[/color][/color][/color]
            layers[color=blue][color=green][color=darkred]
            > > > rendered at the same time.
            > > >
            > > >
            > > > "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
            > > > news:O5xJ2l7eDH A.1872@TK2MSFTN GP09.phx.gbl...
            > > > > Hi,
            > > > >
            > > > > There is nothing to be done in .net , just do the same old trick :)
            > > > > Create two layers, one with the loading ... message and the other[/color][/color]
            > with[color=green][color=darkred]
            > > > all
            > > > > the page the first visible and the latter not visible, on the OnLoad[/color]
            > > event[color=darkred]
            > > > > of the Body tag invert the visibility of them and voila.
            > > > >
            > > > >
            > > > > Hope this help,
            > > > >
            > > > > --
            > > > > Ignacio Machin,
            > > > > ignacio.machin AT dot.state.fl.us
            > > > > Florida Department Of Transportation
            > > > >
            > > > > "Curious George" <mu330__@hotmai l.nospam> wrote in message
            > > > > news:eqLxmY7eDH A.2408@TK2MSFTN GP09.phx.gbl...
            > > > > > I have a page that takes about 10 seconds to load the first time[/color][/color][/color]
            it[color=blue]
            > is[color=green][color=darkred]
            > > > > run.
            > > > > >
            > > > > > I would like to first display a little animated gif telling the[/color][/color][/color]
            user[color=blue][color=green][color=darkred]
            > > > that
            > > > > > the page is loading.
            > > > > >
            > > > > > How do I do this with .NET?
            > > > > >
            > > > > > I used to create a loading layer at the top of the page. Flush[/color][/color][/color]
            the[color=blue][color=green][color=darkred]
            > > > layer
            > > > > to
            > > > > > the buffer.
            > > > > >
            > > > > > Then I set the loading layers visibility false (with JavaScript)[/color][/color][/color]
            and[color=blue][color=green][color=darkred]
            > > > > > generate the page in another layer. Then flush the new HTML to[/color][/color][/color]
            the[color=blue][color=green][color=darkred]
            > > > > buffer.
            > > > > >
            > > > > > How would I do a like thing in .NET?
            > > > > >
            > > > > > George
            > > > > >
            > > > > >
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]




            Comment

            • Horatiu Ripa

              #7
              Re: Loading script.

              Hint

              It got nothing to do with .Net, so it isn't the good place for it.

              There are several ways of doing it but the best one, in my experience is the
              following:
              Make two frames. One with content (fContent), one with "loading" gif and
              text (fLoading).
              Anytime you have a submit/redirect button/link clicked make fContent 0%
              height and the fLoading 100%
              After each Body.onload event make fContent 100% and fLoading 0%.
              Advantages:
              The fLoading shows before the submit, so the time passed from submit to the
              beginning of data receiving from the server the browser will display
              fLoading
              Even if you have redirections, or whatever, it won't flicker.
              The next page will be displayed only when the page is fully loaded (after
              Body.onload event occured)




              --
              Horatiu Ripa

              "Curious George" <mu330__@hotmai l.nospam> wrote in message
              news:eqLxmY7eDH A.2408@TK2MSFTN GP09.phx.gbl...[color=blue]
              > I have a page that takes about 10 seconds to load the first time it is[/color]
              run.[color=blue]
              >
              > I would like to first display a little animated gif telling the user that
              > the page is loading.
              >
              > How do I do this with .NET?
              >
              > I used to create a loading layer at the top of the page. Flush the layer[/color]
              to[color=blue]
              > the buffer.
              >
              > Then I set the loading layers visibility false (with JavaScript) and
              > generate the page in another layer. Then flush the new HTML to the[/color]
              buffer.[color=blue]
              >
              > How would I do a like thing in .NET?
              >
              > George
              >
              >[/color]


              Comment

              Working...