Display "Please Wait" message in IFRAME while remote page loads?

Discussion in 'ASP .Net' started by John Kotuby, Jun 3, 2008.

  1. John Kotuby

    John Kotuby Guest

    Hi all,
    I am working with a web designer to display a large ASPX page (actually a
    1-page multi-function application) in an IFRAME within a regular HTM style
    page.
    The problem we are trying to deal with is that it takes a few seconds to
    load the remote ASPX page as it is fairly large and does some database
    queries during it's setup, depending on which "parent" site is calling it.
    The page uses tables to position elements and the IFRAME resides in a fixed
    position table cell.

    Of course I will try to optimize the page, but I suspect there will still be
    some noticable delay.

    I am trying to come up with a solution that will display a Please Wait
    message and an animated gif in the center of the IFRAME when the "parent"
    page first loads, and then disappears when the IFRAME target finally fills
    the frame.

    My first thought is an absolutely positioned DIV that displays approximately
    in the center of the IFRAME. Then the comes the question of making it
    disappear.

    I know of know way that an HTM page can tell when an IFRAME loads...but
    maybe there is a client event that fires which I am unaware of.

    The other thought is maybe I can Style the DIV with a low Z-order and the
    IFRAME with a high Z-Order, but that just may hide the DIV whether the frame
    target is loaded or not.

    Any help with this will be greatly appreciated...thanks.
     
    John Kotuby, Jun 3, 2008
    #1
    1. Advertising

  2. John Kotuby

    bruce barker Guest

    this won't work very well without some tricky client code. your client code
    will have to load the iframe, wait for the gif to load and start running,
    then request the aspx page. review the google toolkit code to see good
    examples of this.

    you could switch to an update panel which will allow an animation to display
    while loading.


    -- bruce (sqlwork.com)


    "John Kotuby" wrote:

    > Hi all,
    > I am working with a web designer to display a large ASPX page (actually a
    > 1-page multi-function application) in an IFRAME within a regular HTM style
    > page.
    > The problem we are trying to deal with is that it takes a few seconds to
    > load the remote ASPX page as it is fairly large and does some database
    > queries during it's setup, depending on which "parent" site is calling it.
    > The page uses tables to position elements and the IFRAME resides in a fixed
    > position table cell.
    >
    > Of course I will try to optimize the page, but I suspect there will still be
    > some noticable delay.
    >
    > I am trying to come up with a solution that will display a Please Wait
    > message and an animated gif in the center of the IFRAME when the "parent"
    > page first loads, and then disappears when the IFRAME target finally fills
    > the frame.
    >
    > My first thought is an absolutely positioned DIV that displays approximately
    > in the center of the IFRAME. Then the comes the question of making it
    > disappear.
    >
    > I know of know way that an HTM page can tell when an IFRAME loads...but
    > maybe there is a client event that fires which I am unaware of.
    >
    > The other thought is maybe I can Style the DIV with a low Z-order and the
    > IFRAME with a high Z-Order, but that just may hide the DIV whether the frame
    > target is loaded or not.
    >
    > Any help with this will be greatly appreciated...thanks.
    >
    >
    >
    >
     
    bruce barker, Jun 3, 2008
    #2
    1. Advertising

  3. John Kotuby

    John Kotuby Guest

    OK, I must be suffering from brain freeze today. I added the onload event to
    the IFRAME declaration to call the JS function that changes the visibility
    style of the "Please Wait" DIV element to hidden.

    It seems to be working as long as the user allows "ActiveX Controls" as
    prompted by IE7.

    I don't understand why the ActiveX warning if I am just using JavaScript. Oh
    well...

    "John Kotuby" <> wrote in message
    news:...
    > Hi all,
    > I am working with a web designer to display a large ASPX page (actually a
    > 1-page multi-function application) in an IFRAME within a regular HTM style
    > page.
    > The problem we are trying to deal with is that it takes a few seconds to
    > load the remote ASPX page as it is fairly large and does some database
    > queries during it's setup, depending on which "parent" site is calling it.
    > The page uses tables to position elements and the IFRAME resides in a
    > fixed position table cell.
    >
    > Of course I will try to optimize the page, but I suspect there will still
    > be some noticable delay.
    >
    > I am trying to come up with a solution that will display a Please Wait
    > message and an animated gif in the center of the IFRAME when the "parent"
    > page first loads, and then disappears when the IFRAME target finally fills
    > the frame.
    >
    > My first thought is an absolutely positioned DIV that displays
    > approximately in the center of the IFRAME. Then the comes the question of
    > making it disappear.
    >
    > I know of know way that an HTM page can tell when an IFRAME loads...but
    > maybe there is a client event that fires which I am unaware of.
    >
    > The other thought is maybe I can Style the DIV with a low Z-order and the
    > IFRAME with a high Z-Order, but that just may hide the DIV whether the
    > frame target is loaded or not.
    >
    > Any help with this will be greatly appreciated...thanks.
    >
    >
    >
     
    John Kotuby, Jun 3, 2008
    #3
  4. John Kotuby

    John Kotuby Guest

    Bruce,
    Thanks for the tip on reviewing the Google Toolkit code. I'm sure that will
    be helpful.

    It appears that your post showed up just 3 minutes before my own reply to
    the group, where I explain how I used the client onload event of the IFRAME
    to trigger the JS code that makes the absolutely positioned "Waiting" gif
    image invisible. Apparently the event fires when the target site completely
    finishes loading into the frame, much like the body onload event.

    "bruce barker" <> wrote in message
    news:...
    > this won't work very well without some tricky client code. your client
    > code
    > will have to load the iframe, wait for the gif to load and start running,
    > then request the aspx page. review the google toolkit code to see good
    > examples of this.
    >
    > you could switch to an update panel which will allow an animation to
    > display
    > while loading.
    >
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "John Kotuby" wrote:
    >
    >> Hi all,
    >> I am working with a web designer to display a large ASPX page (actually a
    >> 1-page multi-function application) in an IFRAME within a regular HTM
    >> style
    >> page.
    >> The problem we are trying to deal with is that it takes a few seconds to
    >> load the remote ASPX page as it is fairly large and does some database
    >> queries during it's setup, depending on which "parent" site is calling
    >> it.
    >> The page uses tables to position elements and the IFRAME resides in a
    >> fixed
    >> position table cell.
    >>
    >> Of course I will try to optimize the page, but I suspect there will still
    >> be
    >> some noticable delay.
    >>
    >> I am trying to come up with a solution that will display a Please Wait
    >> message and an animated gif in the center of the IFRAME when the "parent"
    >> page first loads, and then disappears when the IFRAME target finally
    >> fills
    >> the frame.
    >>
    >> My first thought is an absolutely positioned DIV that displays
    >> approximately
    >> in the center of the IFRAME. Then the comes the question of making it
    >> disappear.
    >>
    >> I know of know way that an HTM page can tell when an IFRAME loads...but
    >> maybe there is a client event that fires which I am unaware of.
    >>
    >> The other thought is maybe I can Style the DIV with a low Z-order and the
    >> IFRAME with a high Z-Order, but that just may hide the DIV whether the
    >> frame
    >> target is loaded or not.
    >>
    >> Any help with this will be greatly appreciated...thanks.
    >>
    >>
    >>
    >>
     
    John Kotuby, Jun 4, 2008
    #4
  5. Re: Display "Please Wait" message in IFRAME while remote page load

    Mister, any solution about it ? any sample code please ??

    thanks in advance
     
    Alhambra Eidos Kiquenet, Jun 18, 2008
    #5
  6. John Kotuby

    John Kotuby Guest

    Re: Display "Please Wait" message in IFRAME while remote page load

    Yes I did find a solution. I haven't been into the newsgroups in a while so
    didn't see your question and I don't have email notification turned on. In
    effect I created a JavaScript function that handled the onload event of the
    IFRAME.

    <iframe width="99%" style="z-index:1" height="820px" marginheight="4px"
    marginwidth="4px" id="ifSearch" scrolling="no" src=http://example.com
    onload="iframe_onload();"> </iframe>

    <script type="text/jscript" language="javascript">
    function iframe_onload()
    {
    var theWaitCell = document.getElementById('Wait1');
    theWaitCell.style.visibility = "hidden";
    }
    </script>

    What this does is just make the absolutely postioned animated gif become
    invisible once the target web page loaded into the IFRAME. Seems to work
    just fine.

    Here is the code for the absolutely positioned WaitCell.

    <div id="Wait1" style="visibility: visible; position: absolute; top: 40%;
    left: 40%">
    <table id="WaitTable1">
    <tr>
    <td id="WaitCell1" align="center" valign="middle"
    style="background-color: White;
    border-width: 4px; border-style: outset; color: #336699;
    height: 100px; width: 300px;
    font: arial bold 16px">
    <img alt="downloading" src="images/download.gif" />
    <br />
    Search Tool Initializing...
    </td>
    </tr>
    </table>
    </div>

    Hope this helps...

    "Alhambra Eidos Kiquenet" <>
    wrote in message news:...
    > Mister, any solution about it ? any sample code please ??
    >
    > thanks in advance
     
    John Kotuby, Jun 24, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NH
    Replies:
    1
    Views:
    492
    Curt_C [MVP]
    Aug 27, 2004
  2. batham
    Replies:
    1
    Views:
    697
    Wilco Bauwer
    Feb 28, 2005
  3. Jason .

    Please Wait While Page Loads....

    Jason ., Aug 24, 2004, in forum: ASP General
    Replies:
    3
    Views:
    417
    Larry Bud
    Aug 25, 2004
  4. Replies:
    1
    Views:
    214
    Laurent Bugnion
    Jun 9, 2006
  5. Replies:
    0
    Views:
    163
Loading...

Share This Page