views:

209

answers:

1

I see similar questions, but it looks like there were due to an unrelated issue.

in 3.5, I have a custom error handler that logs errors and redirects users. My web.config is set up as such:

    <httpHandlers>
                 <add path="error.ashx" type="MySite.Tools.WebErrorLogger, MySite.Tools" verb="*"/>
    </httpHandlers>
    <customErrors mode="On" defaultRedirect="error.ashx"
                  redirectMode="ResponseRewrite">
    </customErrors>

When redirectMode is set to "ResponseRedirect", everything works fine (but Server.GetLastError() being null but that seems to be intended)

However, when using ResponseRewrite, my handler is not called and I see ASP.Net default error pages. Any idea on how I could do this?

(I unfortunately can't use either an aspx page or do my error handling in global.asax due to other constraints)

A: 

Well, I have asked a pretty similar question in the past.

The solution was converting the error page to a static HTML page.
Surely there must be some kind of error on the dynamic page, but I could not find it.

Eduardo Molteni