Newsgroup: it.comp.www.asp
Titolo: errore con redirect non risolvibile attraverso lettura FAQ

Ho fatto un semplice file ASP
con la singola istruzione
<%
response.redirect("index.htm")
%>
non c'è dentro altro codice !!!
Ho letto le relative FAQ e viene detto di modificare il codice così
<%
Response.Buffer=True
response.redirect("index.htm")
%>
L'errore però continua a essere questo:
Response object error 'ASP 0156 : 80004005'
Header Error
/ridireziona.asp, line 17
The HTTP headers are already written to the client browser. Any HTTP header
modifications must be made before writing page content.
Cosa sbaglio ?

 non c'è dentro altro codice !!!
Attenzione: non è il codice ASP a generare l'errore, ma eventuali tag html o
testo precedenti a <%.
--
Ciao,
   Filippo Di Blasi 
fil...@puntoinformatico.it
   Webmaster(at) 
www.puntoinformatico.it
 <-- E-shop & Usato informatico

 
Ma neanche html?
Non č che hai, di seguito, le headers normali di html? 
Di solito succede cosě.
Se sě, leva tutto, e lascia solo l'istruzione ASP. 
-- 
------------------------------------
Clever Interactive srl
Advanced Web&Multimedia solutions
I-33100, Udine
www.cleverinteractive.it
------------------------------------

Se conosci l'Inglese :
      Question: When I try to do a Reponse.Redirect, it get an error message
about "the HTTP headers are already written..."
      Answer: If you get a message similar to this one
        Response object error 'ASP 0156 : 80004005'
            Header Error
            /somePageName.asp, line 9999
            The HTTP headers are already written to the client browser. Any
HTTP header modifications must be made before writing page content.
      then simply believe the message!
      The rules of Web servers say that you can not do a Response.Redirect
once anything has been written to the browser!
      "But I haven't done any Response.Write before this line!"
      Ahh, but did you code even the tag <HTML> before the
Response.Redirect? That tag sends oodles of stuff to the browser,
automatically!
      So, what can you do?
      Two solutions:
      (1) Don't do any Response.Write or put any ordinary HTML code or even
put in the <HTML> tag until after the point where you do the (possibly
conditional) Response.Redirect.
      Most of the time, this is easy to do. For example, if you are
validating a username and password, there is no need to output anything to
the browser before the point where you discover that one or both of the
values is wrong.
      But if that doesn't work...
      (2) Add the line
        <%
            Response.Buffer
            %>
      before any possible output on the page! Typically, it should be the
first line in the file, barring any <% @ .... %> line you might have.
      Then, if your code decides it needs to do a Response.Redirect, simply
do this:
        <%
            Response.Clear
            Response.Redirect "
http://www.disney.com
"
            %>
      The call to Response.Clear wipes out anything that was sitting in the
buffer waiting to be sent to the user, at which point Response.Redirect is
much happier.
      NOTE: Recent versions of IIS will turn buffering on by default, in
which case the Response.Buffer = True is unnecessary, though the call to
Response.Clear is still needed. However, it can't hurt to be sure buffering
is enabled, so why not drop in that line, just to be safe?
Ciao
Angel