Server.EXECUTE halts page execution in Custom Error pages

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi, I noticed a bizarre issue recently, and was wondering if anyone
knew of a fix or had also encountered this issue:

I have a custom error script (handling 500 and 500-100 errors), which
calls Server.EXECUTE on another file from within the script. The
script is running on IIS 6 (Windows Server 2003). This script
functions correctly when simply requested through the browser, but
when being used as the ASP 500 error handler, it has some bizarre
behavior. When the an error is generated, the execution of the error
page halts after the Server.EXECUTE call.

This is reproducible in the following example (again on Windows Server
2003 running IIS 6):

***** 500.asp (custom error page)
<%
Response.Write("Custom Error Page Execution Begun<br />")
Server.EXECUTE("custom-error-content.asp")
Response.Write("Custom Error Page Execution Completed<br />")
%>

***** custom-error-content.asp
<%
Response.Write("Error Content Generated<br >")
%>

**** force-error.asp
<%
Set example = New Example 'will generate a run-time error since there
is no class Example defined
%>

Requesting 500.asp from the browser produces the expected output:
* Custom Error Page Execution Begun
* Error Content Generated
* Custom Error Page Execution Completed

Requesting force-error.asp though only produces the following output:
* Custom Error Page Execution Begun
* Error Content Generated

The execution of the error page appears to halt after the
Server.EXECUTE call completes. Does anyone know why this is, or a
workaround for it?

Thanks,
Mike Biang
mike.biang@xxxxxxxxx
.



Relevant Pages

  • Re: IIS 404 Error DLL Invoking Question
    ... "Scripts" or "Scripts and Executable" Execution Permission is not set, ... but it still sounds like you have a configuration issue with the ... actual content of the custom error page. ... > by a DLL. ...
    (microsoft.public.inetserver.iis)
  • Re: strange asp 500 error reports download
    ... The behaviour that you were seeing would occur if you have the custom error ... type set to "file" rather than "URL". ... :> If it exists, select it and click Edit, then make sure "Script Engine" ... :>> i have a strange issue with asp error details... ...
    (microsoft.public.inetserver.iis)
  • Re: How to intercept 404 file not found responses
    ... using an aspx page (with some server-side code inside), ... with IIS custom error page since sharepoint engine handle it completely. ... 404 page is a htm template which does have server-side code execution ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Cross Site Scripting & Custom Error Pages
    ... technique. ... > custom error page I append script to the query string this is not removed ... You can turn off the validationRequest property on the custom error page so ...
    (microsoft.public.dotnet.framework.aspnet.security)