With ASP.NET MVC it is pretty easy to integrate an IoC container to create the controllers.
Is the same thing also possible with webforms to create the pages and controls and pass them any dependencies? If yes, where do I have to plug it in?
With ASP.NET MVC it is pretty easy to integrate an IoC container to create the controllers.
Is the same thing also possible with webforms to create the pages and controls and pass them any dependencies? If yes, where do I have to plug it in?
Castle Windsor was the first major IoC container for ASP.NET. See this question discussing how it can be used with Web forms.
Not directly, as Web Forms does not allow any code to take control of Page and Control instantiation. So something like a Page Factory is not feasible, and you can't do constructor injection.
But there are work arounds/hacks that can buy you setter injection as others have mentioned.
Another good approach would be using the Model-View-Presenter pattern and have your dependencies injected into the presenter's constructor.