473,405 Members | 2,261 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,405 software developers and data experts.

location.replace question

Wondering if anybody knows how to get around this problem ...

I am creating a "Please wait..." page to show a friendly message to my
site users while the data is being loaded. I am using
location.replace() javascript function to do this.

The problem that I am facing is displaying the records that the
application has already processed on the wait page. Does anybody know
what can I do to pass data field value from the end page where the data
processing is going in background on to the wait page.

Oct 16 '06 #1
5 2606
I don't know about .net but in most scripting environments the page
will print all output until the script terminates, resulting in a page
that grows as more and more is processed. If this won't do you can use
ajax along with a timeout to query the server about how much data has
been processed.

Unless I completely misunderstood what you want to do... in which case,
you may try pointing to an example on your staging server.

donet programmer wrote:
Wondering if anybody knows how to get around this problem ...

I am creating a "Please wait..." page to show a friendly message to my
site users while the data is being loaded. I am using
location.replace() javascript function to do this.

The problem that I am facing is displaying the records that the
application has already processed on the wait page. Does anybody know
what can I do to pass data field value from the end page where the data
processing is going in background on to the wait page.
Oct 16 '06 #2
Thanks Joshie for taking time for helping me out with this problem. I
think you got a good idea of what I am trying to achieve.
My dotnet app has 3 pages StartPage.aspx, WaitPage.aspx and
ResultPage.aspx.

Basic functionality is very simple, I take input from user on
StartPage.aspx.
I pass the input to ResultPage.aspx as a query string.
The result page takes the input and runs a query with that input on db.

[This query fetches around 500 records and takes around 2 min. to
retrieve results].
Until all 500 records are fetched the application just stays on the
StartPage.aspx with a busy icon and progress of the fetch in status bar
of the page.

To eliminate this wait, I introduced a WaitPage.aspx.
When the application starts processing the input on the
ResultPage.aspx, it redirects the user to the wait page. On the wait
page i call following javascript funtion redirectTo() on body onload()
of wait page.

I pass targetPage = "ResultPage.aspx", total = 500 and processed = 0.
This part works great. Now I need to update this value of processed
with the real time actual value of records that are already fetched by
the query which is running on the ResultPage.aspx.
<script>
var i = 0;
var secondsForWaiting = 30;

function redirectTo(targetPage, total, processed)
{

if ( total = 0 )
ProcessingLabel.innerText = "Establishing connection...";
if (0 < targetPage.length)
{
location.replace(targetPage);
b1.style.cursor="wait";
if (secondsForWaiting.valueOf() 0)
{
ProcessingLabel.innerText =
"This process can take up to "
+ secondsForWaiting + " seconds..."
+ "Total records processed " + processed + " out of " +
total;
timedIterations(secondsForWaiting);
}

}
else
{
ProcessingLabel.innerText = "Page not found."
}
}

function timedIterations(secondsForIterating)
{
incrementalWidth = 600 / secondsForIterating;
if (i <= secondsForIterating + 10)
{
d1.innerText="Elapsed time: " + i + " seconds.";
d2.style.width=i*incrementalWidth;
setTimeout(
"timedIterations(" + secondsForIterating + ");",
1000);
i++;
}
else
{
b1.style.cursor="";
d1.style.visibility = "hidden";
d2.style.visibility = "hidden";
ProcessingLabel.innerText =
"The server is taking longer than "
+ "anticipated to process your request. "
+ "Thank you for your patience. "
+ "You can wait a few minutes longer for "
+ "the process to complete, or you can press "
+ "the back button and try again later...";
}
}
</script>

Oct 16 '06 #3
"donet programmer" <ar******@gmail.comwrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
Wondering if anybody knows how to get around this problem ...

I am creating a "Please wait..." page to show a friendly message to my
site users while the data is being loaded. I am using
location.replace() javascript function to do this.

The problem that I am facing is displaying the records that the
application has already processed on the wait page. Does anybody know
what can I do to pass data field value from the end page where the data
processing is going in background on to the wait page.
1. You need to control what your server is sending to the browser during
its lengthy processing. Wait until the processing is complete, THEN send
the results to the browser.

2. You are not the first person facing this challenge.

3. By googling "asp progress bar" the first result

http://www.eggheadcafe.com/articles/20010610.asp

shows how to do exactly what you want.
Oct 16 '06 #4
Awesome!!!!!! Thanks Jim loooks goood ... will try it out

Jim Land NO SPAM wrote:
"donet programmer" <ar******@gmail.comwrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
Wondering if anybody knows how to get around this problem ...

I am creating a "Please wait..." page to show a friendly message to my
site users while the data is being loaded. I am using
location.replace() javascript function to do this.

The problem that I am facing is displaying the records that the
application has already processed on the wait page. Does anybody know
what can I do to pass data field value from the end page where the data
processing is going in background on to the wait page.

1. You need to control what your server is sending to the browser during
its lengthy processing. Wait until the processing is complete, THEN send
the results to the browser.

2. You are not the first person facing this challenge.

3. By googling "asp progress bar" the first result

http://www.eggheadcafe.com/articles/20010610.asp

shows how to do exactly what you want.
Oct 16 '06 #5
"donet programmer" <ar******@gmail.comwrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
I am creating a "Please wait..." page to show a friendly message to
my
site users while the data is being loaded. I am using
location.replace() javascript function to do this.
>3. By googling "asp progress bar" the first result

http://www.eggheadcafe.com/articles/20010610.asp

shows how to do exactly what you want.
Awesome!!!!!! Thanks Jim loooks goood ... will try it out

And if that solution doesn't fit your situation, the google search turned
up half a million other possibilities... :-)
Oct 16 '06 #6

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

Similar topics

3
by: Andoni | last post by:
Hi, I am only writing for IE 5.5+ so no need for compatibility at all ;-) I am trying to get my users to logoff which they finish on a particular page. This is no problem (or should be no...
2
by: James Marshall | last post by:
I'm trying to override location.replace() but I can't. I can override window.open(), document.write(), and other built-in methods, but not location.replace(). Here's a demo that overrides two...
5
by: spam_me_ not | last post by:
I already understand that one cannot disable a browser's forward and back functions. This is a situation where I have code working in Mozilla V1.6 and would like something similar for Opera and...
10
by: Roland | last post by:
Hello, the example code is the following(the number in parentheses at the beginning are just for reference)(The complete HTML file is at the end of this article): (1)window.location =...
1
by: solutions | last post by:
Hi, Here is my relevant code for an arbitrary page (let's call it PAGE_B): <body onload="window.location.hash='anchor';"> With this code, if the user goes from PAGE_A to PAGE_B, he will jump...
2
by: JHB | last post by:
Hi, How can I do a location.replace when I use a form, like when I use a href? This works. <a href="Ny HTML-side20.htm"; method="post" id="frm" name="BrugerHovedSide"...
3
by: Al | last post by:
Hi all... I have created an aspx page that contains an animated GIF. I am using javascript and location.replace to redirect from this page to another aspx page which takes several seconds to...
9
by: Jean Pierre Daviau | last post by:
Hi everybody, I have this function in a page (namely cours.html) function go(inValue) { var lien = 'file:///F:/MyWebs/jeanpierredaviaucom/httpdocs/cours1.html?T1=' + document.R.T1.value;
12
by: Jack | last post by:
Since, I have not got some desired advise, I am reposting this for some asnwer/valuable suggestion. Thanks. THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE <% sql01 = "SELECT COUNT(*) AS...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.