Loading ...
Sorry, an error occurred while loading the content.

Include() vs. TrapInclude()

Expand Messages
  • Arnon Weinberg
    Just thought I d post this for anyone else that might run into a similar situation... The documentation seems to suggest that Include() and TrapInclude() are
    Message 1 of 1 , Apr 30, 2012
    • 0 Attachment
      Just thought I'd post this for anyone else that might run into a similar
      situation...

      The documentation seems to suggest that Include() and TrapInclude() are
      interchangeable, apart from the buffering that happens. That is:
      <%
      $Response->Include('test.inc');
      %>
      should be equivalent to:
      <%=
      ${$Response->TrapInclude('test.inc')}
      %>
      with respect to output.

      However, TrapInclude() creates a local output buffer, whereas Include()
      does not, so certain methods behave differently if they run inside an
      Include() file vs. a TrapInclude() file. For example,
      $Response->Clear(), $Response->End(), and $Response->Flush() produce
      different results. Their behaviour is a natural consequence of local
      output buffering, so just something to be aware of.

      Also, when Buffering is turned on, the behaviour of $Response->End() is
      not as expected given a local output buffer, as it ends the program, but
      does not flush the caller's buffer, so this may be a minor bug.


      --
      -------------------------------------------------------------------------------
      Arnon Weinberg
      www.back2front.ca



      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    Your message has been successfully submitted and would be delivered to recipients shortly.