Header Error? Already Written to Browser?

Results 1 to 4 of 4

Thread: Header Error? Already Written to Browser?

  1. #1
    Steffan Guest

    Default Header Error? Already Written to Browser?

    Response object error &#039ASP 0156 : 80004005&#039 <BR><BR>I am getting this error. At First it complained when I had server.transfer "abc.page"<BR>So I changed to response.redirect "abc.page"<BR><BR>And then I got the Header Error?<BR><BR>Header Error <BR><BR>/LoginVerification.asp, line 25 <BR><BR>The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. <BR>

  2. #2
    Murale Guest

    Default RE: Header Error? Already Written to Browser?

    Check u might have writte any think like response.write "Some string" it will make such problem

  3. #3
    Join Date
    Dec 1969

    Default RE: Header Error? Already Written to Browser?

    The response.redirect call must be made within ASP code BEFORE the &#060;html&#062; etc code is written. This meands that if you do want to redirect the user then none of the html of that page is written. <BR>Also make sure that you include the line &#060;%response.buffer = TRUE%&#062; at the top of your page. An example:-<BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;%Response.Buffer=TRUE%&#062;<BR>& #060;%<BR>&#039ASP CODE................ <BR>response.redirect "yourpage.htm"<BR>%&#062;<BR><BR><BR>&#060;HTML&#0 62;<BR>&#060;HEAD&#062;<BR>etc..................<B R><BR><BR>GaryDee<BR>Ireland

  4. #4
    Karl Guest

    Default RE: Header Error? Already Written to Browser?

    It is important to know the interaction going on between the server and the client, before you can become a successful webmaster.<BR><BR>Basically, it&#039s important to realize that there&#039s a set of communication between the server and the browser which happens BEFORE the page is sent to the client.<BR><BR>Something along the lines of<BR>Client request page<BR>Server sends headers and status (like 404 if page doesn&#039t exist, or 200 if everything is ok) and thent he body of the page.<BR><BR>Well certain things need to be included in the server&#039s response<BR>before the body of the page is sent. For examples, any cookie operation needs to be done before any part of the body is sent out, as does a response.redirect. <BR><BR>If you read your error message, it&#039s basically saying that you tried doing something which had to be done before the headers are written to the client - that is they have to be added to the headers and sent along with them.<BR><BR>In order to avoid this error you have 2 solutions:<BR><BR>1) make sure whatever you are doing, such as response.redirect or cookie manipulation occurs before ANY html. You see, the header stops being sent, and the body begainst as soon as a normal html tag begins (typically that&#039s &#060;html&#062;)<BR><BR>2) use resposne.buffer = true at the top of your page, which buffers the output of your page, meaning that no HTML is sent until the entire page is processed.<BR><BR>Karl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts