Groups | Blog | Home
all groups > inetserver asp db > may 2005 >

inetserver asp db : message displaying


mgreenway NO[at]SPAM gmail.com
5/31/2005 4:22:26 PM
Unfortunately there is no way to have ASP remove the text that has
already been posted to a user's browser. But there is a small work
around

The simplest way to do this has 3 parts.

First : you will need to put this in the first couple of lines of the
page

Response.Buffer = False

Second:
Before your code begins to operate you should output the
Response.write("Please Wait while Schedule Generates")

Third:
you will need to send a Meta Refresh tag such as
Response.write("<META HTTP-EQUIV=Refresh CONTENT=""1;
URL=/GeneratedSchedule.asp"">")


This will send the client computer to the GeneratedSchedule page after
1 second.

you could also send it to the page you are already on with a
querystring that says that it has already been calculated.


Hope that works

MGReenway
Pervaiz Khawaja
5/31/2005 5:43:25 PM

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

Bob Barrows [MVP]
6/1/2005 7:15:14 AM
[quoted text, click to view]

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"

AddThis Social Bookmark Button