Response.Clear with a Response.Redirect

Discussion in 'ASP General' started by nettleby@googlemail.com, Nov 4, 2006.

  1. Guest

    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.
    , Nov 4, 2006
    #1
    1. Advertising

  2. Evertjan. Guest

    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?


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Nov 4, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,215
    Srowe1975
    Oct 15, 2008
  2. David

    Response.Clear() doesn't clear

    David, Jan 31, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    995
    Mark Fitzpatrick
    Jan 31, 2008
  3. Sal
    Replies:
    1
    Views:
    376
  4. InvalidLastName

    Unrecognized element 'add' after <clear></clear>

    InvalidLastName, Feb 26, 2007, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    926
    Steven Cheng[MSFT]
    Mar 6, 2007
  5. Ron Howard
    Replies:
    2
    Views:
    506
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page