錯誤未被重定向到Http處理程序我看到類似的問題,但看起來像是由於一個無關的問題。如果redirectMode =「ResponseRewrite」
在3.5,我有一個自定義的錯誤處理程序,記錄錯誤並重定向用戶。我的web.config中被設置爲這樣:
<httpHandlers>
<add path="error.ashx" type="MySite.Tools.WebErrorLogger, MySite.Tools" verb="*"/>
</httpHandlers>
<customErrors mode="On" defaultRedirect="error.ashx"
redirectMode="ResponseRewrite">
</customErrors>
當redirectMode設置爲"ResponseRedirect"
,一切工作正常(但Server.GetLastError()爲空,但似乎意)
然而,當使用ResponseRewrite
,我的處理程序不被調用,我看到ASP.Net默認錯誤頁面。任何想法如何我可以做到這一點?
(可惜我不能使用任何一個aspx頁面或做我的錯誤在Global.asax中處理由於其他方面的限制)
這裏與Web窗體和路由相同的問題,在我的情況下,即使靜態頁面不起作用,所以我已經刪除了redirectMode =「ResponseRewrite」 – GibboK 2011-09-01 12:13:02