p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Professional (http://p2p.wrox.com/forumdisplay.php?f=63)
-   -   Response.Flush (http://p2p.wrox.com/showthread.php?t=5188)

jeffm_22 October 20th, 2003 08:34 AM

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?

Imar October 20th, 2003 08:39 AM

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.

All times are GMT -4. The time now is 02:31 AM.

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