How to make custom error pages work in ASP.NET MVC 4

前端 未结 11 2240
陌清茗
陌清茗 2020-11-22 12:25

I want a custom error page shown for 500, 404 and 403. Here\'s what I have done:

  1. Enabled custom errors in the web.config as follows:

    
    
            
11条回答
  •  一向
    一向 (楼主)
    2020-11-22 13:24

    I've done pablo solution and I always had the error (MVC4)

    The view 'Error' or its master was not found or no view engine supports the searched location.

    To get rid of this, remove the line

     filters.Add(new HandleErrorAttribute());
    

    in FilterConfig.cs

提交回复
热议问题