attribute does not seem to act at all

前端 未结 6 903
佛祖请我去吃肉
佛祖请我去吃肉 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:31

    I got the same issue and it took me two full days to figure it out finally. It turned out to be that I got an error in Site.Master page, and the Error.aspx used this same master page as all other pages. Obviously the Error.aspx couldn't deal with such situation.

    My solution is to create a specific Error.master page that is lightweight and does not include any model data. Additionaly I created a static Error.htm in case an error occurs from Error.aspx. The Web.config setting is as follows:

    
        
    
    

    Hope it helps.

提交回复
热议问题