By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 1,837 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

Loading script.

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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" <mu*****@hotmail.nospam> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
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

Nov 15 '05 #2

P: n/a
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.machin AT dot.state.fl.us> wrote in message
news:O5**************@TK2MSFTNGP09.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 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" <mu*****@hotmail.nospam> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
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


Nov 15 '05 #3

P: n/a
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["preloadlayer"].style.visibility = "hidden";
documents.all["pagelayer"].style.visibility = "visible";
}
</script>

<body onLoad ="ShowPage();">
<div id="preloadlayer" name="preloadlayer" visibility="visible:visible;">
loading ...
</div>
<div id="pagelayer" id="pagelayer" style="visibility:hidden;">
<form>
</form>
</div>
</body>

Hope this help,

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

"Curious George" <mu*****@hotmail.nospam> wrote in message
news:eJ*************@TK2MSFTNGP11.phx.gbl...
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.machin AT dot.state.fl.us> wrote in message
news:O5**************@TK2MSFTNGP09.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 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" <mu*****@hotmail.nospam> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
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



Nov 15 '05 #4

P: n/a
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.machin AT dot.state.fl.us> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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["preloadlayer"].style.visibility = "hidden";
documents.all["pagelayer"].style.visibility = "visible";
}
</script>

<body onLoad ="ShowPage();">
<div id="preloadlayer" name="preloadlayer" visibility="visible:visible;">
loading ...
</div>
<div id="pagelayer" id="pagelayer" style="visibility:hidden;">
<form>
</form>
</div>
</body>

Hope this help,

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

"Curious George" <mu*****@hotmail.nospam> wrote in message
news:eJ*************@TK2MSFTNGP11.phx.gbl...
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.machin AT dot.state.fl.us> wrote in message
news:O5**************@TK2MSFTNGP09.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 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" <mu*****@hotmail.nospam> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
> 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
>
>



Nov 15 '05 #5

P: n/a
Sorry example would not render inline.
"Curious George" <mu*****@hotmail.nospam> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.machin AT dot.state.fl.us> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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["preloadlayer"].style.visibility = "hidden";
documents.all["pagelayer"].style.visibility = "visible";
}
</script>

<body onLoad ="ShowPage();">
<div id="preloadlayer" name="preloadlayer" visibility="visible:visible;">
loading ...
</div>
<div id="pagelayer" id="pagelayer" style="visibility:hidden;">
<form>
</form>
</div>
</body>

Hope this help,

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

"Curious George" <mu*****@hotmail.nospam> wrote in message
news:eJ*************@TK2MSFTNGP11.phx.gbl...
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.machin AT dot.state.fl.us> wrote in message
news:O5**************@TK2MSFTNGP09.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
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" <mu*****@hotmail.nospam> wrote in message
> news:eq**************@TK2MSFTNGP09.phx.gbl...
> > 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
> >
> >
>
>





Nov 15 '05 #6

P: n/a
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" <mu*****@hotmail.nospam> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
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

Nov 15 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.