Custom ASP.NET MVC ActionFilterAttribute - hooks never get called

前端 未结 7 531
故里飘歌
故里飘歌 2021-01-01 18:50

Hi I`m trying to do something that seems kinda easy, and is documented that way but for some reason its not going that easy.

Basiclly I wrote something like this:

7条回答
  •  不思量自难忘°
    2021-01-01 19:42

    A probably silly suggestion but did you add it to your global.asax?
    This is an example from one of my apps:

    public class MvcApplication : System.Web.HttpApplication     
    {
      public static void RegisterGlobalFilters(GlobalFilterCollection filters)
      {
        filters.Add(new LogonAuthorize());
        filters.Add(new HandleErrorAttribute());
      }
    }
    

提交回复
热议问题