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>