Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Please Wait

Reply
Thread Tools

Please Wait

 
 
mw
Guest
Posts: n/a
 
      10-15-2004
I'm writing an application that's going to do alot of processing while the
user is waiting, (imagine sitting and waiting while the server/background
processing is occurring). What's the best way to entertain the user (e.g.
show them something's happening - e.g. animated gif progress bar or
something) and then automatically show the "done" page when the processing
is finished.

Thanks!


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJhZCBSb2JlcnRz?=
Guest
Posts: n/a
 
      10-15-2004
Check out this recent article

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

"mw" wrote:

> I'm writing an application that's going to do alot of processing while the
> user is waiting, (imagine sitting and waiting while the server/background
> processing is occurring). What's the best way to entertain the user (e.g.
> show them something's happening - e.g. animated gif progress bar or
> something) and then automatically show the "done" page when the processing
> is finished.
>
> Thanks!
>
>
>

 
Reply With Quote
 
 
 
 
Sahil Malik
Guest
Posts: n/a
 
      10-15-2004
Maybe you want to look into delegating that task to another process, and the
page refreshes itself every few seconds to show the end user a progress bar
or something like that. Long running processes that are oltp based are
always clumsy in Asp.net :-/
That'll keep them busy, but If you really wanna entertain them, maybe you
could show them a blonde joke at every page refresh (just kidding).

- Sahil Malik
You can reach me thru my blog http://www.dotnetjunkies.com/weblog/sahilmalik



"mw" <(E-Mail Removed)> wrote in message
news:ZGJbd.90465$a85.38249@fed1read04...
> I'm writing an application that's going to do alot of processing while the
> user is waiting, (imagine sitting and waiting while the server/background
> processing is occurring). What's the best way to entertain the user (e.g.
> show them something's happening - e.g. animated gif progress bar or
> something) and then automatically show the "done" page when the processing
> is finished.
>
> Thanks!
>
>



 
Reply With Quote
 
=?Utf-8?B?RGFuIE5hc2g=?=
Guest
Posts: n/a
 
      10-15-2004
Hi

How does Duncan's code help in a Web Forms situation? Someone clicks submit
on a form or something, the asp does the code behind for the next page (which
does whatever they submitted it to do). How does the progress bar fit in?

dan


"mw" wrote:

> I'm writing an application that's going to do alot of processing while the
> user is waiting, (imagine sitting and waiting while the server/background
> processing is occurring). What's the best way to entertain the user (e.g.
> show them something's happening - e.g. animated gif progress bar or
> something) and then automatically show the "done" page when the processing
> is finished.
>
> Thanks!
>
>
>

 
Reply With Quote
 
=?Utf-8?B?QnJhZCBSb2JlcnRz?=
Guest
Posts: n/a
 
      10-15-2004
My apologies. The article I referenced was not the one I intended. (So many
ideas...) I have used the included aspx page to display a progress bar while
another aspx page is performing a long-running process to collect report
data. This page is started by calling it with the name of the long-running
page in the QueryString.



<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="PleaseWait.aspx.vb" Inherits="BRS_Vouchers.PleaseWait"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>PleaseWait</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<META http-equiv=Refresh
content='3; URL=<% =(Request.QueryString("TargetPage") & "?x=" &
DateTime.Now.ToString("ddMMMyyyyHmmss")) %>'>
<SCRIPT language="javascript">
var i = 0;
function ProgressBar(secondsForWaiting, minutesForWaiting)
{
if (secondsForWaiting.valueOf() > 0)
{
d3.innerText = "This process can take up to "
+ secondsForWaiting + " seconds...";
timedIterations(secondsForWaiting);
}
else
{
if (minutesForWaiting.valueOf() > 0)
{
d3.innerText =
"This process can take up to "
+ minutesForWaiting + " minutes...";
timedIterations(minutesForWaiting * 60);
}
}
}

function timedIterations(secondsForIterating)
{
incrementalWidth = 800 / secondsForIterating;
if (i <= secondsForIterating + 10)
{
d1.innerText="Elapsed time: " + i + " seconds.";
d2.style.width=i*incrementalWidth;
setTimeout("timedIterations(" + secondsForIterating + ");", 1000);
i++;
}
else
{
d1.style.visibility = "hidden";
d2.style.visibility = "hidden";
d3.innerText =
"The server is taking longer than "
+ "anticipated to process your request. "
+ "Thank you for your patience. "
}
}
</SCRIPT>
</HEAD>
<body bgColor="#96b0be" topMargin="0" onload="ProgressBar(60,0);"
MS_POSITIONING="FlowLayout">
<TABLE id="Table1" style="WIDTH: 100%; HEIGHT: 65px" borderColor="#000000"
cellSpacing="0"
cellPadding="1" border="0">
<TR>
<TD style="HEIGHT: 65px" vAlign="bottom" align="center"
bgColor="black"></TD>
<TD style="WIDTH: 797px; HEIGHT: 65px" vAlign="bottom" align="center"
width="797" background="images/BRS_Title.jpg"
colSpan="1" rowSpan="1">
<P><asp:label id="PageHeaderLabel" runat="server" Font-Names="Arial"
Font-Size="Medium" BorderStyle="None"
Font-Bold="True" ForeColor="#ffffff"></asp:label></P>
</TD>
<TD style="HEIGHT: 65px" vAlign="bottom" align="center"
bgColor="#000000"></TD>
</TR>
</TABLE>
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
<TR>
<TD align="center" width="100%"><font size="6">
<P><b>Please Wait
<br>
Processing for the report...</b></P>
</font>
<P><b><asp:label id="StartTimeLabel" runat="server"
EnableViewState="False" Font-Names="Arial" Font-Size="Large"
BorderStyle="None"></asp:label></b></P>
<font size="4">
<P>This report is in a new browser window.<br>
Please close this window as soon as you are finished with the report.
</P>
</font>
</TD>
</TR>
<tr>
<td align="center" width="100%"><font size="4">
<div id="d1" style="FONT-WEIGHT: bold; FONT-FAMILY: Arial"></div>
</font>
<div id="d2" style="BACKGROUND-COLOR: red"></div>
<font size="4">
<div id="d3" style="FONT-WEIGHT: bold; FONT-FAMILY: Arial"></div>
</font>
</td>
</tr>
</TABLE>
</form>
</body>
</HTML>

 
Reply With Quote
 
=?Utf-8?B?RGFuIE5hc2g=?=
Guest
Posts: n/a
 
      10-15-2004
Hi Brad,

Cool.

2 things though...

Is there anything in the CodeBehind file we should know about? And whats
BRS_Vouchers.PleaseWait - is that something that's included or a component or
what?

Cheers

Dan


"Brad Roberts" wrote:

> My apologies. The article I referenced was not the one I intended. (So many
> ideas...) I have used the included aspx page to display a progress bar while
> another aspx page is performing a long-running process to collect report
> data. This page is started by calling it with the name of the long-running
> page in the QueryString.
>
>
>
> <%@ Page Language="vb" AutoEventWireup="false"
> Codebehind="PleaseWait.aspx.vb" Inherits="BRS_Vouchers.PleaseWait"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>PleaseWait</title>
> <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
> <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
> <meta content="JavaScript" name="vs_defaultClientScript">
> <meta content="http://schemas.microsoft.com/intellisense/ie5"
> name="vs_targetSchema">
> <META http-equiv=Refresh
> content='3; URL=<% =(Request.QueryString("TargetPage") & "?x=" &
> DateTime.Now.ToString("ddMMMyyyyHmmss")) %>'>
> <SCRIPT language="javascript">
> var i = 0;
> function ProgressBar(secondsForWaiting, minutesForWaiting)
> {
> if (secondsForWaiting.valueOf() > 0)
> {
> d3.innerText = "This process can take up to "
> + secondsForWaiting + " seconds...";
> timedIterations(secondsForWaiting);
> }
> else
> {
> if (minutesForWaiting.valueOf() > 0)
> {
> d3.innerText =
> "This process can take up to "
> + minutesForWaiting + " minutes...";
> timedIterations(minutesForWaiting * 60);
> }
> }
> }
>
> function timedIterations(secondsForIterating)
> {
> incrementalWidth = 800 / secondsForIterating;
> if (i <= secondsForIterating + 10)
> {
> d1.innerText="Elapsed time: " + i + " seconds.";
> d2.style.width=i*incrementalWidth;
> setTimeout("timedIterations(" + secondsForIterating + ");", 1000);
> i++;
> }
> else
> {
> d1.style.visibility = "hidden";
> d2.style.visibility = "hidden";
> d3.innerText =
> "The server is taking longer than "
> + "anticipated to process your request. "
> + "Thank you for your patience. "
> }
> }
> </SCRIPT>
> </HEAD>
> <body bgColor="#96b0be" topMargin="0" onload="ProgressBar(60,0);"
> MS_POSITIONING="FlowLayout">
> <TABLE id="Table1" style="WIDTH: 100%; HEIGHT: 65px" borderColor="#000000"
> cellSpacing="0"
> cellPadding="1" border="0">
> <TR>
> <TD style="HEIGHT: 65px" vAlign="bottom" align="center"
> bgColor="black"></TD>
> <TD style="WIDTH: 797px; HEIGHT: 65px" vAlign="bottom" align="center"
> width="797" background="images/BRS_Title.jpg"
> colSpan="1" rowSpan="1">
> <P><asp:label id="PageHeaderLabel" runat="server" Font-Names="Arial"
> Font-Size="Medium" BorderStyle="None"
> Font-Bold="True" ForeColor="#ffffff"></asp:label></P>
> </TD>
> <TD style="HEIGHT: 65px" vAlign="bottom" align="center"
> bgColor="#000000"></TD>
> </TR>
> </TABLE>
> <form id="Form1" method="post" runat="server">
> <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
> <TR>
> <TD align="center" width="100%"><font size="6">
> <P><b>Please Wait
> <br>
> Processing for the report...</b></P>
> </font>
> <P><b><asp:label id="StartTimeLabel" runat="server"
> EnableViewState="False" Font-Names="Arial" Font-Size="Large"
> BorderStyle="None"></asp:label></b></P>
> <font size="4">
> <P>This report is in a new browser window.<br>
> Please close this window as soon as you are finished with the report.
> </P>
> </font>
> </TD>
> </TR>
> <tr>
> <td align="center" width="100%"><font size="4">
> <div id="d1" style="FONT-WEIGHT: bold; FONT-FAMILY: Arial"></div>
> </font>
> <div id="d2" style="BACKGROUND-COLOR: red"></div>
> <font size="4">
> <div id="d3" style="FONT-WEIGHT: bold; FONT-FAMILY: Arial"></div>
> </font>
> </td>
> </tr>
> </TABLE>
> </form>
> </body>
> </HTML>
>

 
Reply With Quote
 
=?Utf-8?B?QnJhZCBSb2JlcnRz?=
Guest
Posts: n/a
 
      10-15-2004
1) The only thing in the code behind is one line of code to populate a label
on the page with the current time.

2) I probably should have just left that line out. That is just the
reference to the code-behind page. The name of the page in my code is
"PleaseWait.aspx".

"Dan Nash" wrote:

> Hi Brad,
>
> Cool.
>
> 2 things though...
>
> Is there anything in the CodeBehind file we should know about? And whats
> BRS_Vouchers.PleaseWait - is that something that's included or a component or
> what?
>
> Cheers
>
> Dan
>
>
> "Brad Roberts" wrote:
>
> > My apologies. The article I referenced was not the one I intended. (So many
> > ideas...) I have used the included aspx page to display a progress bar while
> > another aspx page is performing a long-running process to collect report
> > data. This page is started by calling it with the name of the long-running
> > page in the QueryString.
> >
> >
> >
> > <%@ Page Language="vb" AutoEventWireup="false"
> > Codebehind="PleaseWait.aspx.vb" Inherits="BRS_Vouchers.PleaseWait"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML>
> > <HEAD>
> > <title>PleaseWait</title>
> > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
> > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
> > <meta content="JavaScript" name="vs_defaultClientScript">
> > <meta content="http://schemas.microsoft.com/intellisense/ie5"
> > name="vs_targetSchema">
> > <META http-equiv=Refresh
> > content='3; URL=<% =(Request.QueryString("TargetPage") & "?x=" &
> > DateTime.Now.ToString("ddMMMyyyyHmmss")) %>'>
> > <SCRIPT language="javascript">
> > var i = 0;
> > function ProgressBar(secondsForWaiting, minutesForWaiting)
> > {
> > if (secondsForWaiting.valueOf() > 0)
> > {
> > d3.innerText = "This process can take up to "
> > + secondsForWaiting + " seconds...";
> > timedIterations(secondsForWaiting);
> > }
> > else
> > {
> > if (minutesForWaiting.valueOf() > 0)
> > {
> > d3.innerText =
> > "This process can take up to "
> > + minutesForWaiting + " minutes...";
> > timedIterations(minutesForWaiting * 60);
> > }
> > }
> > }
> >
> > function timedIterations(secondsForIterating)
> > {
> > incrementalWidth = 800 / secondsForIterating;
> > if (i <= secondsForIterating + 10)
> > {
> > d1.innerText="Elapsed time: " + i + " seconds.";
> > d2.style.width=i*incrementalWidth;
> > setTimeout("timedIterations(" + secondsForIterating + ");", 1000);
> > i++;
> > }
> > else
> > {
> > d1.style.visibility = "hidden";
> > d2.style.visibility = "hidden";
> > d3.innerText =
> > "The server is taking longer than "
> > + "anticipated to process your request. "
> > + "Thank you for your patience. "
> > }
> > }
> > </SCRIPT>
> > </HEAD>
> > <body bgColor="#96b0be" topMargin="0" onload="ProgressBar(60,0);"
> > MS_POSITIONING="FlowLayout">
> > <TABLE id="Table1" style="WIDTH: 100%; HEIGHT: 65px" borderColor="#000000"
> > cellSpacing="0"
> > cellPadding="1" border="0">
> > <TR>
> > <TD style="HEIGHT: 65px" vAlign="bottom" align="center"
> > bgColor="black"></TD>
> > <TD style="WIDTH: 797px; HEIGHT: 65px" vAlign="bottom" align="center"
> > width="797" background="images/BRS_Title.jpg"
> > colSpan="1" rowSpan="1">
> > <P><asp:label id="PageHeaderLabel" runat="server" Font-Names="Arial"
> > Font-Size="Medium" BorderStyle="None"
> > Font-Bold="True" ForeColor="#ffffff"></asp:label></P>
> > </TD>
> > <TD style="HEIGHT: 65px" vAlign="bottom" align="center"
> > bgColor="#000000"></TD>
> > </TR>
> > </TABLE>
> > <form id="Form1" method="post" runat="server">
> > <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
> > <TR>
> > <TD align="center" width="100%"><font size="6">
> > <P><b>Please Wait
> > <br>
> > Processing for the report...</b></P>
> > </font>
> > <P><b><asp:label id="StartTimeLabel" runat="server"
> > EnableViewState="False" Font-Names="Arial" Font-Size="Large"
> > BorderStyle="None"></asp:label></b></P>
> > <font size="4">
> > <P>This report is in a new browser window.<br>
> > Please close this window as soon as you are finished with the report.
> > </P>
> > </font>
> > </TD>
> > </TR>
> > <tr>
> > <td align="center" width="100%"><font size="4">
> > <div id="d1" style="FONT-WEIGHT: bold; FONT-FAMILY: Arial"></div>
> > </font>
> > <div id="d2" style="BACKGROUND-COLOR: red"></div>
> > <font size="4">
> > <div id="d3" style="FONT-WEIGHT: bold; FONT-FAMILY: Arial"></div>
> > </font>
> > </td>
> > </tr>
> > </TABLE>
> > </form>
> > </body>
> > </HTML>
> >

 
Reply With Quote
 
Alex Homer
Guest
Posts: n/a
 
      10-15-2004
Here's a few ideas, with [view source] links and you can downlod the code:
http://www.daveandal.net/books/6744/samples.aspx

a.. Chapter 3 - Loading Progress and Status Displays
a.. Displaying a "Please Wait" Message
a.. Displaying a "Progress Bar" Graphic
a.. Displaying Staged Page Load Progress


"mw" <(E-Mail Removed)> wrote in message
news:ZGJbd.90465$a85.38249@fed1read04...
> I'm writing an application that's going to do alot of processing while the
> user is waiting, (imagine sitting and waiting while the server/background
> processing is occurring). What's the best way to entertain the user (e.g.
> show them something's happening - e.g. animated gif progress bar or
> something) and then automatically show the "done" page when the processing
> is finished.
>
> Thanks!
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make "fork/wait" to WAIT longer? Huey C Programming 1 03-01-2004 02:01 PM
please help... ...me learn C++ please please please :) KK C++ 2 10-14-2003 02:08 PM
please wait.. page joe kenney ASP .Net 1 08-14-2003 07:06 PM
Re: best way to do a "please wait" message Craig Deelsnyder ASP .Net 1 08-04-2003 05:53 AM
Implement a Please Wait Page Stephajn Craig ASP .Net 4 07-25-2003 06:13 AM



Advertisments