Response.Redirect problem

Results 1 to 4 of 4

Thread: Response.Redirect problem

  1. #1
    David Le Strat Guest

    Default Response.Redirect problem

    I have been trying to do a logon page where the page reloads itself with an error message added if the query didn&#039t return any result for the login. To do so, I redirect the response to the page itself using the SCRIPT_NAME header. I receive this error that I cannot figure out:<BR><BR>Response object error &#039ASP 0156 : 80004005&#039 <BR>Header Error <BR>The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content<BR><BR>Any idea?<BR><BR>Thanks.

  2. #2
    Manpreet Guest

    Default RE: Response.Redirect problem

    well, once the page has been processed, all the HTTP heaers have been made and sent out 2 the client so there is no way u can change them. the redirection works only if the "response.ridirect" comes before the &#060;html>&#060;head>....<BR>So that&#039s it. i have been using a technique to get around this though. if the input from the usr is not correct u wanna refresh the pg right. just add this javascript >> response.write ("&#060;script language="javascript">document.location.href="your loginpage.asp"&#060;/script>") . i have ignored the "s ofcourse. bye!

  3. #3
    Kenneth -DZ- Silver Guest

    Default RE: Response.Redirect problem

    You can also stick the Response.Redirect AFTER the closing &#060;/html> tag. Another nice method is to If Then your html altogether. i.e.:<BR><BR>&#060;% If condition = True Then &#037;&#062;<BR>&#060;html>&#060;body>your page&#060;/body>&#060;/html><BR>&#060;% Else Response.Redirect ... &#037;&#062;<BR>&#060;% End If &#037;&#062;<BR><BR>Cheers, -dz<BR>LINE9.com<BR><BR>

  4. #4
    Marcel Vogel Guest

    Default RE: Response.Redirect problem

    Try putting this piece of code at the top of your page.<BR><BR>&#060;% Response.Buffer = true &#037;&#062;<BR><BR>Marcel.<BR>


Posting Permissions

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