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

location.replace question

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.