user1495475
user1495475

Reputation: 1057

ASP:Error "The HTTP headers are already written to the client browser."

Im getting following error in a asp file.Below is my error.I dont get the error offen but I do get it sometimes.

Error:-->

"Response object error 'ASP 0156 : 80004005' Header Error /UseFull/Quelables.asp, line 3 The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content."

//code in that asp page

<!--#include file="folder1/newFill.asp" -->
<%
    Response.CharSet ="UTF-8"
    Dim asp, strQue

Line 3 here is "Response.CharSet".What is the problem? please suggest some answer.

Upvotes: 0

Views: 2280

Answers (2)

Kul-Tigin
Kul-Tigin

Reputation: 16950

Sent headers cannot modify. Looks like buffering is on and headers already sent to the client. To get rid of this, you need to turn on buffering. When buffering is off, all operations over Response object made immediately and it's irreversible in most cases. There must be Response.Buffer = False in folder1/newFill.asp. Change it to Response.Buffer = True.

Upvotes: 1

AardVark71
AardVark71

Reputation: 4116

By specifying the Response.Charset you are actually instructing asp to set an encoding metatag and yes this is set in the header of the page and must be set before anything is output to the page (e.g. any response.write).

If you need your output to be in UTF-8, try putting the charset on top of your page as follows:

The output is what you are setting with the meta tag and could also be set as follows:

<% Response.CharSet ="UTF-8" %>
<!--#include file="folder1/newFill.asp" -->
<%
    Dim asp, strQue

Upvotes: 0

Related Questions