attribute does not seem to act at all

前端 未结 6 911
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-16 17:58

I am having problems using the [HandleError] attribute on my Controller Actions - it doesn\'t seem to work at all (i.e. it doesn\'t matter if the filter is there or not - I

6条回答
  •  孤城傲影
    2020-12-16 18:24

    To get around the 404 problem when the Error.aspx was supposed to be shown, I had to exclude the Error.aspx from the httpHandler section which prevented any views from being accessed directly (around the mvc 2 framework). I did this by putting Error.aspx in an 'Error' subfolder and putting a web.config in this subfolder with a in the httpHandlers section. My version of this problem (and its solution) may be specific to MVC 2.

    Remember to update the defaultRedirect reference, when you move Error.aspx :)

提交回复
热议问题