View Complete Thread
  • Re: Response.Flush breaks IIS's "Custom Errors"

    Jun 05, 2006 10:01 PM|goinoutwest|LINK

    You are correct, that after Response.Flush has been called the headers are sent to the client.  So, it is therefore impossible to change that 200OK into a 500 response code.  I have no issues with that.

    However, there seems to be no reason that the "Custom Error" page could not be invoked at the time of the error.  Often times, developers used code in the "Custom Error" page to alert them that an error had occurred on their web site.  If they use Response.Flush before the error occurs their alerting/logging mechanism will not be triggered.

    The only alternative (when using Response.Flush on a page) is to use the horrible OnError ResumeNext style error trapping.