Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Response.Clear with a Response.Redirect

Reply
Thread Tools

Response.Clear with a Response.Redirect

 
 
nettleby@googlemail.com
Guest
Posts: n/a
 
      11-04-2006
The Microsoft site has confused me on this issue:
http://www.microsoft.com/technet/pro....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.

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-04-2006
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/pro...erv/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?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments