In MVC 3, I understand you can create custom WebViewPages. Can you inject dependencies, using constructor injection, via an IOC container?
It is not possible to perform constructor injection. But you can do something like this with, say, Ninject:
public abstract class CustomViewBase: WebViewPage where TModel : class { [Inject] public IFace Face { get; set; } }
And assuming you have set up IDependencyResolver in Global.asax you should correctly have the @Face property initialised. But one important caveat: you may not access @Face in _Layout.cshtml, because (according to Brad Wilson) Layout works outside MVC, and @Face will be null when you try to access it in the layout page.
In any case I agree with the others in that the view should not have to deal with any complex logic.