473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
Nov 15 '05 #1
6 3100
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jacques Chaurette | last post by:
Hello all , thanks in advance for any help. While looking for a solution to how to replace the grey box while an applet loads, a search of Google got me an article by Glenn s. Peffers that claims to...
4
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just...
2
by: hbchai | last post by:
I'm adapting the ajax-like asynchronous request pattern mentioned in this article: http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html?page=2 for my Sudoku...
1
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr =...
3
by: matdumsa | last post by:
Hi there!!! I'm wondering what I've did wrong here... I try to do a gmail-like "loading" red square at top right... Here is my code: <div id=loading...
5
by: toffee | last post by:
Hi all, I've seen a really cool effect which i would like to use on an intranet site. Am referring to the 'LOADING..' animation you see when switching pages. I've seen it somewhere on a website...
2
by: boczek | last post by:
Hello all. I'm writing a small async webapp. in JavaScript and I'm using <script> element technique to load data. I'm usign <scriptbecause of cross domain restrictions with XmlRequest. The...
6
by: Venkatesh | last post by:
Hello All, I have couple of doubts regarding the concept of on-demand javascript loading using javascript code. I could see on the net different techniques for achieving this - techniques like:...
13
eragon
by: eragon | last post by:
JavaScript Loading Mask Requirements: Little knowledge in JavaScript and some HTML. JavaScript enabled browser. Applications: Useful for all those pages that load slow, and in sections, so...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.