Click to See Complete Forum and Search --> : Response.Flush Question
lmf232s
12-02-2004, 01:57 PM
I have a page that hits an Oracle Database big time.
I am retreving data for the course of the last year, based
on vendors. I am pulling data based on the vendor in ASC order.
After i pull all the data for that vendor I pass variables to
a function that creats a chart based on the data. After the .jpg for the chart is created, I then calculate all the data for that vendor.
The end result is 86 reports with charts included.
All this works.
Any way, I thought I would display a Please wait processing....
While everyting is running.
The problem is, that nothing will display untill the page is finished
running.
I have tried to use resonse.flush to write a simple
response.write " i made it"
but this will not display untill the script is done running.
I put some javascript at the top of the page to open a new window,
that would display some info for them and then close it when it is
finished but the winodw again does not open until the script is
finished running.
Any ides, comments, on what i am missing and how i can get this to
work.
Thanks.
russell_b
12-02-2004, 02:08 PM
buffering turned on? Response.Buffer = true
If Response.Buffer Then Response.Flush
lmf232s
12-02-2004, 02:12 PM
Yes i thought by default buffering was turned on. (on newer versions
of IIS)
but i went ahead a put
response.buffer = true.
This is what i have as a test at the top of the page.
<%option explicit
Response.Buffer = True%>
<!--#include virtual=Include/Common.asp-->
<!--#include virtual=VendorPerformance/Include/DateDisplay.asp-->
<LINK REL=stylesheet HREF=../../Include/IDIapp.css TYPE=text/css>
<LINK REL=stylesheet HREF=../../Include/EDMD.css TYPE=text/css>
<table>
<tr>
<td>I made it</td>
</tr>
</table>
<%response.flush%>
This this is the meat of the asp here.
This does not work and will not display the table.
lmf232s
12-02-2004, 02:31 PM
Dont get it.
I have one page that has this.
<%option explicit
Response.Buffer = True
Dim i, r%>
<table>
<tr>
<td>I made it</td>
</tr>
</table>
<%Response.Flush
for i = 1 to 5000000
r = r + i
Next
response.write " i made it "
response.flush%>
and it works.
I place this same code on the page i mentioned earlier without the
for loop and it does not work.
It will not display "I made it" untill the whole page is done.
russell_b
12-02-2004, 02:51 PM
lmf, check this out. this works on my servers. see if you can modify for your purposes:
<%
Response.Buffer = true
Dim i, j
Dim o
Response.Write "<html>" & vbCrLf
Response.Write "<body>" & vbCrLf
Response.Write "Updating..."
Response.Write "<div style=""width:704px; border:1px black solid"">"
Response.Write "<div id=pb style=""width:1px; height:12px; background-color:red""></div>"
Response.Write "</div>"
Response.Write "</body>" & vbCrLf
Response.Write "</html>" & vbCrLf
For i = 0 to 700
update
'' the next few lines are just to kill time
'' this is where your long running part would be
for j = 0 to 500
set o = server.CreateObject("ADODB.Command")
Set o = nothing
Next
Next
Response.Write "<br>Finished"
Sub update()
%>
<script language="javascript">
w = parseInt(document.getElementById("pb").style.width) + 1;
document.getElementById("pb").style.width = w;
</script>
<%
Response.Flush
End Sub
%>
lmf232s
12-02-2004, 02:57 PM
Nope does not display until the whole page is finished loading.
Has to be something in IIS then?
DOnt know.
Any ideas?
Ok, I just ran this page from my laptop and it does what
it is supposed to do, So it must be an IE setting.
Now i just have to find which one.
Ok , i take that back, when i typed the address into the address
bar the page works fine, but when i run it from local mode out of
MS Visual InterDev it does not work.
What do you think,k
all in all it is working now, but now im curious why it wont work
out of interdev, which is how i view my pages i am working on.
Oh well.
Thanks russell,
Now i dont even think this was an issue because i was running them
out of interdev everytime.
russell_b
12-02-2004, 03:18 PM
are you behind a proxy server?
response.expiresAbsolut = date() -1 ?
lmf232s
12-02-2004, 03:24 PM
no im not behind a proxy server.
Im internal,
If i was hitting it from outside the company, I would be.
whats the
<%Response.ExpiresAbsolute = date() - 1 %>
for
russell_b
12-02-2004, 03:29 PM
ahh, just saw your edit. we were typing at the same time again :). glad u worked it out.
rb