Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. 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 Professional 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 October 20th, 2003, 08:34 AM
Registered User
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Response.Flush

I am using response.buffer = true to have a java please wait screen. I have all my checks which includes response.redirect after the response.flush and none of them work. When I put the response.redirect's before the response.flush everything works fine. Is there a way to make the redirects work after the response.flush?
  #2 (permalink)  
Old October 20th, 2003, 08:39 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Nope. This is by design. When you send output to the browser, you actually send an HTTP Header and a HTTP Body. Cookies, Redirect statements, etc are placed in the header. The page contents are send in the body.

For technical reasons, the header must be sent before the body. So, as soon as you flush some content to the browser, the header must already have been sent, so you can't access or modify it anymore with a Response.Redirect statement.

You can, however, simulate this with some JavaScript. Instead of the Redirect statement, send some JavaScript that requests a new page using location.href.



Imar Spaanjaars
Everyone is unique, except for me.

Similar Threads
Thread Thread Starter Forum Replies Last Post
RESPONSE BUFFER / FLUSH pallone .NET Framework 2.0 3 May 11th, 2008 01:39 PM
response.flush isn't working cookster Classic ASP Basics 6 July 31st, 2004 05:44 AM
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

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