Results 1 to 3 of 3

Thread: response.redirect

  1. #1
    Join Date
    Dec 1969

    Default response.redirect

    I have a script that displays a reciept of what was entered into a form after it sends the info. to a database and what I&#039m trying to do is have it redirect to a different page if there is an incorrect password. I keep getting the error: "Response object error &#039ASP 0156 : 80004005&#039 -Header Error- The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content." The redirect is under the Else part of the If... Then statement. Any ideas? - Thanx<BR>

  2. #2
    Join Date
    Dec 1969

    Default Another one that should be in FAQ...

    &nbsp;<BR>...but for some reason isn&#039t. Ah, well.<BR><BR>************<BR><BR>Read the error message: Your ASP page has already sent out info to the client before it encounters your redirect. <BR><BR>Two solutions:<BR><BR>(1) Just be sure you do the Response.Redirect *BEFORE* the &#060;HTML&#062; tag.<BR><BR>(2) Turn on buffering (Response.Buffer = true) and then clear the buffer before redirecting.<BR><BR>Personally, I just use (1) because it is easier and more logical, anyway. But whatever.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: response.redirect

    The response.redirect has to be written before any html<BR><BR>but if you are doing a redirect you shouldn&#039t need any html unless you are using an If statement<BR><BR>&#060;%<BR>If Something Then<BR>response.redirect"somepage"<BR>Else<BR>%&# 062;<BR>html code<BR>&#060;%End If%&#062;

Posting Permissions

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