I thought a progress bar would be quite easy to do but am having some problems. The idea was to calculate the percentage at the end of each loop then use some javascript to jump to cause another frame in the browser (in this case called bottom) to re-load. The page would receive a parameter and this would decide what % width the table is.
The only problem I have is that even though I can see in the status bar that the bottom frame is having data sent to it at the end of each loop and I can see the % in the URL is going up it is only right at the end once the ASP has finished that the progres bar updates. So it starts at 0 then jumps straight to 100% at the end with nothing inbetween.
Is there any way round this? I have tried using META refresh on the progress frame to 1 second but that didn't seem to work either.
eg:
<%
'Make sure data is passed back to the client on a regular basis
Response.Buffer = False
For i=1 to counter
...
PercentComplete=int(i/counter)*100
%>
<script>window.open('enumerateprogress.asp?PercentComplete=<% = PercentComplete %>','bottom')</script>
<%
Next
and on enumerateprogress.asp
<table width="100%" border="2">
<tr>
<td>
<table border="0" width="<% = Request.QueryString("PercentComplete") %>">
<tr><td bgcolor="red"> </td></tr>
</table>
</td>
</tr>
</table>
<% Response.Write(Request.QueryString("PercentComplete")) %>
The only problem I have is that even though I can see in the status bar that the bottom frame is having data sent to it at the end of each loop and I can see the % in the URL is going up it is only right at the end once the ASP has finished that the progres bar updates. So it starts at 0 then jumps straight to 100% at the end with nothing inbetween.
Is there any way round this? I have tried using META refresh on the progress frame to 1 second but that didn't seem to work either.
eg:
<%
'Make sure data is passed back to the client on a regular basis
Response.Buffer = False
For i=1 to counter
...
PercentComplete=int(i/counter)*100
%>
<script>window.open('enumerateprogress.asp?PercentComplete=<% = PercentComplete %>','bottom')</script>
<%
Next
and on enumerateprogress.asp
<table width="100%" border="2">
<tr>
<td>
<table border="0" width="<% = Request.QueryString("PercentComplete") %>">
<tr><td bgcolor="red"> </td></tr>
</table>
</td>
</tr>
</table>
<% Response.Write(Request.QueryString("PercentComplete")) %>