Response.Clear with a Response.Redirect

N

nettleby

The Microsoft site has confused me on this issue:
http://www.microsoft.com/technet/pr.../reskit/iisbook/c06_redirection.mspx?mfr=true

Says that:
"ASP automatically discards any existing output in the buffer when you
call Response.Redirect "

But then the code example has a Response.Clear in, i.e.

If Err.Number > 0 Then
Response.Clear
Response.Redirect "./error.mspx"
End If

Does anyone know whether a Response.Clear is needed or not? Or does it
vary on different versions?

Thanks.
 
E

Evertjan.

wrote on 04 nov 2006 in microsoft.public.inetserver.asp.general:
The Microsoft site has confused me on this issue:
http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/iis
book/c06_redirection.mspx?mfr=true

Says that:
"ASP automatically discards any existing output in the buffer when you
call Response.Redirect "

But then the code example has a Response.Clear in, i.e.

If Err.Number > 0 Then
Response.Clear
Response.Redirect "./error.mspx"
End If

Does anyone know whether a Response.Clear is needed or not? Or does it
vary on different versions?

Read the text on that page:
"If you dont know at the beginning of the page whether you need to
redirect, you can use the buffering capabilities of the Response object. If
Response.Buffer is True, HTML output is collected in a buffer and sent all
at once to the client. If at some point you need to redirect to another
page, ASP automatically discards any existing output in the buffer when you
call Response.Redirect. You may also use Response.Clear at any time to
clear the buffer and start again."

"... start again." ???
The last sentence perhaps belongs on another spec page, and the MS specs
writers are cached22 in their own copy and pasting?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top