Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 28th, 2004, 03:18 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default response.flush isn't working

Hi, I'm using the progress bar code I found in this forum. Problem is, I can't get response.flush to work in IE6. It works fine in Netscape, but not IE. Nothing appears on screen until the entire script is processed. Any ideas? This is driving me crazy...

Cookster

  #2 (permalink)  
Old July 29th, 2004, 12:03 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

can u post u r code.

And make sure that response.buffer should be true.



  #3 (permalink)  
Old July 29th, 2004, 04:37 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

You should set response.buffer=true. But if you do not set this, it should give an error.

I would suggest putting response.buffer=false so that whatever is ready for display will get displayed in browser immediately.

If you are putting all your code in a single outer table, then flushing the buffer is not of any use. Some browsers will wait till the ending table tag is found.

You may breakup the page into a number of small small horizontal tables of equal width and same alignment, you can override this problem.

BTW, have you heard about table-less design ? You may visit following links in your free time.

http://glish.com/css/
www.zeldman.com
www.csszengarden.com
  #4 (permalink)  
Old July 29th, 2004, 08:24 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's my code. It's basically the same code found in the example. I added a delay loop in the middle to slow down execution speed so I could see the effect.

Again, this works in netscape, but not IE6. I don't have IE 5 (IMS rules) so I can't test it on another version of IE.

<%Response.Buffer = True
server.scriptTimeout =25000
%>
<div id="ProgBar" style="font-family:Verdana; font-size=9pt;">Progress:<BR>
<TABLE style="color:red;" HEIGHT="16" Border=1>
<TR><TD BGCOLOR=RED ID="statuspic"></TD></TR></TABLE>
</div>
<script language="Javascript">var progBarWidth=250;
</script>
<%
iProcessedSoFar = 0
iTotalRecords = 300
ii = 0
strHTML="<Table width='80%'><TR><TD Width='100%' BGCOLOR='gray' align='CENTER'>Results:<TD><TR>"
for i = 0 to iTotalRecords

strHTML = strHTML & "<TR width='100%'><td width='100%' BGCOLOR='#FFCC66'>Your results</td></tr>"
    'added delay loop
    for ii = 0 to 40000
    ii = ii +1
    next
iProcessedSoFar = iProcessedSoFar + 1
pctComplete = (iProcessedSoFar / iTotalRecords)
    If i mod 8 = 0 then
        ShowProgress pctComplete
        response.write pctComplete & "<BR>"
    End if
Next
FinishProgress

strHTML=strHTML &"</TABLE>"
Response.write strHTML

Sub ShowProgress(nPctComplete)
response.write "here"
Response.Write "<SCR" & "IPT LANGUAGE='JavaScript'>" & vbCrlf
Response.Write "statuspic.width = Math.ceil(" & nPctComplete & " * 250);" &vbCrlf
Response.Write "</SCR" &"IPT>"
response.flush
End Sub

Sub FinishProgress
'Response.Write "<SCR" &"IPT LANGUAGE='JavaScript'>" & vbCrlf
'Response.Write "ProgBar.style.visibility ='hidden';" & vbCrLf
'Response.Write "</SCR" &"IPT>"
End sub
%>

  #5 (permalink)  
Old July 29th, 2004, 03:03 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

More info. I've tried this code on a few other PCs, all with IE6, and it works fine. I must have some kind if IE6 bug or something on my PC. Oh well...

  #6 (permalink)  
Old July 30th, 2004, 12:07 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

This code is working perfectly in my PC. It is correct also.

You may first check the security settings in your PC. If "Active scripting" is disabled, this won't work.

If problem persists, you may have to re-install IE browser.
  #7 (permalink)  
Old July 31st, 2004, 05:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, looks like the problem is with your IE settings. As Madhu suggested, check if that ("Active scripting") is enabled. There is nothing wrong with the code posted here, that works fine for me.

_________________________
- Vijay G
Strive for Perfection


Similar Threads
Thread Thread Starter Forum Replies Last Post
RESPONSE BUFFER / FLUSH pallone .NET Framework 2.0 3 May 11th, 2008 01:39 PM
Jsp out.flush() not working on IBM Websphere AS400 mmalik_altaf Pro JSP 0 June 28th, 2004 09:40 AM
How to Flush out Cache on my local computer bekim VB.NET 2002/2003 Basics 1 June 16th, 2004 08:59 AM
Response.Flush jeffm_22 Classic ASP Professional 1 October 20th, 2003 08:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.