I'm trying to create a custom error page for the 404.13 error (when a user tries to upload a file too large). What I want to be able to do is log information on the error (page name especially), but I can't seem to configure the IIS 7 error-handling properly.
I'm guessing in order to get this to work I need to use the "Execute a URL on this site" option in the custom error page setup... Here's how that looks in my web.config file:
<httpErrors errorMode="Custom">
<error statusCode="404" subStatusCode="13" path="/ErrorPages/404-13.asp" responseMode="ExecuteURL" />
</httpErrors>
However, when I do this, I only get IE's "friendly" error message when my custom error is supposed to load:
I don't have this issue if I use either of the other two options: "Insert content from static file into the error response" or "Respond with a 302 redirect". But neither of those options seem to allow me to have the error-logging capabilities I need (one's static, the other loses error info in the redirect).
Any ideas on how to get responseMode="ExecuteURL" to work? Thanks in advance!
Extra Info
Here's my test custom error page (/ErrorPages/404-13.asp):
<%@ language="VBScript" %>
<html>
<head></head>
<body>
<div>
Test: <%=Request.ServerVariables("SCRIPT_NAME")%><br />
<%
Set objASPError = Server.GetLastError
Response.write "Code: " & objASPError.ASPCode
%>
</div>
</body>
</html>
Edit
I should have also specified that I do have IIS configured to send errors to the browser. I only get this generic IE error when testing my custom error page in "ExecuteURL" mode.