473,606 Members | 2,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display animation while waiting for server to respond.


Hello,

I attended a seminar with scott gu. Microsoft asp.net lead guru, and he
mentioned some advanced
javascript that let you display an animation while your page is waiting for
response from the server.

He said these scripts could be found on his blog but , so far i have not
been able to find them.
I did send him an e-mail but no luck, no response.

Does anyone know of these script or know how to do this?

Many thanks in advance

JB
Nov 19 '05 #1
5 9012
Try this:

<html>
<head>
<title></title>
<script language="javas cript">
function toggle(e) {
if (e.style.displa y == "none") {
e.style.display = "";
} else {
e.style.display = "none";
}
}
</script>
</head>
<body onload="toggle( progress)">
<div id="progress">A nimation/Text/What Ever Here</div>
</body>
</html>

Hope that helps.

Simon.

Nov 19 '05 #2
> }
}
</script>
</head>
<body onload="toggle( progress)">
<div id="progress">A nimation/Text/What Ever Here</div>
</body>
</html>

Hope that helps.

Simon.


Great,
Thank you
JB
Nov 19 '05 #3
> </script>
</head>
<body onload="toggle( progress)">
<div id="progress">A nimation/Text/What Ever Here</div>
</body>
</html>

Hope that helps.

Simon.


How should this be used in an aspx page?

In your example, shouldn't it display "Animation/Text/What Ever Here" until
the page i rendered?

This is not what happens in my case. I still see white background while page
is loading.



Nov 19 '05 #4
To be honest, I grabbed that from an old ASP app. Thinking back, the
code I have you will help when the page has a big file size, not when
the server processing takes time.

Perhaps this will help:
http://www.dotnetjunkies.com/Forums/...px?PostID=1169

Nov 19 '05 #5
JB,

Instead of having the user call the slow-loading page directly, you
will need to create an intermediate page. You pass the URL (with
querystring) of the slow-loading page to the intermediate page, which
in turn calls the slow-loading page using javascript. In the interim,
it does something (shows "progress bar", message or animation).

I have attached some example script which should help you. The initial
calling page is called orderstart.aspx . The intermediate page is
pageload.aspx and the slow-loading page is called ordercomplete.a spx
(not shown here directly). This code is from an asp.net "Black belt"
presentation by INETA.

Bill E.
Hollywood, FL
_______________ _______________ __
orderstart.aspx .vb

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Server.Transfer ("PageLoad.aspx ?Page=ordercomp lete.aspx?partn umber=" &
TextBox1.Text, True)
End Sub
_______________ _______________ __
pageload.aspx

<HTML>
<HEAD>
<title>PageLoad </title>
<script language="javas cript">

var iLoopCounter = 1;
var iMaxLoop = 6;
var iIntervalId;

function BeginPageLoad() {
location.href = "<%= Request.QuerySt ring("Page")%>" ;
iIntervalId =
window.setInter val("iLoopCount er=UpdateProgre ssMeter(iLoopCo unter,
iMaxLoop)", 500);
}

function EndPageLoad() {
window.clearInt erval(iInterval Id);
ProgressMeter.i nnerText = "Page Loaded -- Not Transferring";
}

function UpdateProgressM eter(iCurrentLo opCounter, iMaximumLoops) {

iCurrentLoopCou nter += 1;

if (iCurrentLoopCo unter <= iMaximumLoops) {
ProgressMeter.i nnerText += ".";
return iCurrentLoopCou nter;
}
else {
ProgressMeter.i nnerText = "";
return 1;
}
}

</script>
</HEAD>
<body onload="BeginPa geLoad()" onunload="EndPa geLoad()">
<form id="Form1" method="post" runat="server">
<table border="0" cellpadding="0" cellspacing="0" width="99%"
height="99%" align="center"
valign="middle" >
<tr>
<td align="center" valign="middle" >
<font color="navy" size="7">
<span id="MessageText ">Processin g Order&nbsp;-- Please
Wait</span>
<span id="ProgressMet er"
style="WIDTH:25 px;TEXT-ALIGN:left"></span>
</font>
</td>
</tr>
</table>
</form>
</body>
</HTML>

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6607
by: Brainless | last post by:
hi... I've recently created a dhtml thing on http://www.shapers.nl/ that animates a lot of images. The thing I want to solve is the lag that occurs when a new animation is initiated. To make it time-based I calculate the entire animation on beforehand and create numerous setTimeOuts in a repeat loop (it's the loop that creates the lag). Creating an animation like this has some more disadvantages:
2
2104
by: billrdio | last post by:
I am trying to make a JavaScript animation of real-time images - i.e. images that will periodically change on the server. The problem I am having is that the JavaScript animation I have created is always using the images from the cache, even though I have set the HTTP response header on the server (via .htaccess) so that the browser should validate the image in the cache against the image on the server for freshness. I have tested the...
5
2098
by: wmschneider | last post by:
I am trying to make a progress animation so that the user knows that there files are correctly being checked in. Trying to animate papers moving from the computer to the server pics. I'm brand new at this language, however, I've been programming in C++ for awhile. This is my code for that part of it. And I call the startAnimation() function when the button finish is clicked on. Represented like: <INPUT TYPE="SUBMIT" NAME="SUBMIT"...
7
2004
by: Burns | last post by:
Hi, I'm writing some code that talks to a POP3 server with a TcpClient. I can send and receive using a NetworkStream, but when I send my message, then try to recieve, no response has returned. I'm assuming that this is because the server hasn't had the chance to respond before the recieve buffer is read. If this is the case, then how do I tell my code to wait around before checking the stream? If I just have a do{}until loop constantly...
3
3081
by: NL | last post by:
Hi, Does anybody know how to turn off the animation Windows does with a window as it's minimized/maximized to the taskbar? I have an app which, when minimized, syncs to any other open instances of the app and tells them to minimize. If I have more than a couple instances open, the user ends up waiting quite a while for all of windows to minimize, since each minimizing animation is done consecutively and not in parallel.
3
1116
by: Kiran B. | last post by:
hi, i have a search.aspx page and from there it displays and go to searchresualt.aspx... Is there a way I can display an animation ..or something else while it's searching...coz; my search takes a long time about 55 sec or so because of the data.... Thanks
4
2784
by: petermichaux | last post by:
Hi, Is there any way to make DOM scripted animation smoother? Flash is far superior in this area. Any one here know what makes Flash so smooth by comparison? I don't like the fact that the standards based world is so far behind the Flash based stuff in some areas (animation and server push in particular)
4
3257
by: Jono | last post by:
Hi Everyone, As it says in the title, I'm looking for a way to display a page while long running operations are performed on the server. Ideally, I'd like some way to push the current request onto some stack, where it would continue to be processed asynchronously (most importantly preserving things like view state, form post data, etc). In the interim, while the main request is processed, a friendly page will be displayed to the user....
4
4005
by: avicalc | last post by:
I need help with the structure of a JavaScript program. My process is as follows: 1) Get JSON data via XMLHttpRequest. 2) When done with the above, process the JSON data which may take up to 3 seconds. 3) Because of the possibility of a time consuming operation, display a simple animation ("Loading...", etc) while the user is waiting. What I need help with is how to control the animation. I know that I
0
8045
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7981
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8320
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5994
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3952
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2458
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.