Hi there,
The error most likely occurs in pages that write cookies or try to redirect somewhere in the content section of the page (after you have already outputted some content to the browser).
By design, you'll need to send the entire HTTP header information for a page to the browser before you send any content (including spaces etc). If you try to modify the header after you send some content, this error will occur.
There are two ways to overcome this problem:
1. Write cookies and redirect before you send content to the browser, like this:
Code:
<%
' business decisions here.
'Cookies, redirects etc go here.
%>
<html>
This way, you'll avoid the problem by sending header info before content.
2. Like Chris mentioned, you can turn on
buffering. It can be done on a page basis (like the example Chris showed) or on web server basis. (It's likely that your new server has turned this option off). To change it, open IIS, and then the
Properties dialog of your website. On the
Home Directory tab, click
Configuration. Select
Enable Buffering on the
Options tab.
Personally, I think a mix of both solutions is the best way. Solution 1 is good because it forces you to pack all your business logic decisions together which makes your code easier to understand.
Solution 2 is good because buffering improves the performance of a ASP page (that's why it's on by default on IIS5+ webservers).
HtH
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.