阅读背景:

一种在ASP.NET MVC中排除动作过滤器的方法?

来源:互联网 

I've run into several cases in ASP.NET MVC where I wanted to apply an action filter on every action except one or two. For example, say you have an AccountController. Every action in it requires the user be logged in, so you add [Authorize] at the controller level. But say you want to include the login page in AccountController. The problem is, users sent to the login page aren't authorized, so this would result in an infinite loop. I've run into several cases in ASP.NET MVC wher




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: