ASP.NET MVC's RequireHttps attribute allows for securing controllers and controller methods, but it's limited to either on or off states statically. In this post Rick Strahl discuss a custom attribute that can dynamically set SSL usage based on a configuration setting or delegate.
Go to the complete details ...