1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

WHat is "http headers"?

Discussion in 'C#' started by gilgalbiblewheel, Sep 12, 2005.

  1. #1
    The redirect page is giving error.
     
    gilgalbiblewheel, Sep 12, 2005 IP
  2. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sounds like you are trying to do a redirect after data has been sent to the browser.

    "Any HTTP header modifications must be made before writing page content."

    Good luck
     
    ServerUnion, Sep 12, 2005 IP
  3. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This usually means there was some error and with the error it outputs some error message to the browser and it has to send the headers to be able to do this. Then when you get to your code that sends headers, oops they have already been sent.
     
    exam, Sep 12, 2005 IP
  4. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    try putting this at the top of your page:

    <%response.buffer=true%>
     
    vectorgraphx, Sep 13, 2005 IP
  5. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What happens is that you are trying to set a new header not at the beginning of the page, when some of the response, including HTTP headers was already sent to the user. In other words, if you have something like this:

    Response.Write(somedata);
    Response.AddHeader(header, value);

    , you may get this error, depending on how much data is being sent in the first call.

    Move your call that modifies headers (e.g. AddHeader, Redirect, etc) to the beginning of the page and this problem will go away.

    J.D.
     
    J.D., Sep 13, 2005 IP
  6. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #6

    I place this on most of my pages, works great.
     
    ServerUnion, Sep 13, 2005 IP
  7. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It's turned on by default - no need to make ASP process more directives than it needs :)

    J.D.
     
    J.D., Sep 13, 2005 IP
  8. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #8
    depends on your version of ISS you are running. If was turned on, he wouldn't be getting the error...
     
    ServerUnion, Sep 13, 2005 IP