[quoted text, click to view] Pervaiz Khawaja wrote:
> Can you please help me in asp code. I am display a message
> when webpage downloading "Please Wait while
> Schedule Generates" and message should go away when page
> finished downloading.
> I appreciate your help. thanks
You can use Response.Buffer=True, Response.Flush, and some client-side code
to make this happen. Here is an example of using this technique to present a
progress bar to the user:
<%@ Language=VBScript %>
<%Response.Buffer=true%>
<HTML><BODY>
<style type="text/css">
..pBar {
border: thin inset black;
background-color:navajowhite;
padding-left:5px;
padding-right:5px
}
div.1 {
border-top:5px solid navajowhite;
border-bottom:5px solid navajowhite;
text-align: left;
background-color: navajowhite;
width: 100%;
height: 10px;
}
div.2 {
border-top:5px solid navajowhite;
border-bottom:5px solid navajowhite;
text-align: right;
background-color: blue;
color:white;
height: 10px;
}
</style>
<span id=spTime></span><BR>
<div id=progressBar class=pBar>
<div id="hr1" class=1></div></div>
<script type="text/jscript">
function setbar( nPct )
{
hr1.className="2";
spTime.innerText=nPct + "%";
hr1.style.width= nPct + "%";
}
setbar(0);
</script>
<%
Response.Flush
'Here is where the long-running script starts
dim i
for i = 1 to 1000000 'simulate long running script
'update "percent complete" periodically.
if i/10000 = CLng(i/10000) then
'Response.Write CStr(Clng(i/10000)) & "-"
Response.Write "<script language=""javascript"">setbar(" &
CStr(CLng(i/10000)) & ");</script>"
Response.Flush
End if
next
%>
<!--the rest of the page follows here-->
</BODY>
<script type="text/jscript">
progressBar.style.display="none";
spTime.innerText="Finished";
</script>
</HTML>
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"