Doing Inversion Of Control with webforms aspx user control

158 Views Asked by At
  • WebForms 4.61
  • IoC is done using Castle Windsor

I have a legacy WebForms application that I am working on adding IoC to. I implemented constructor and property injection for Page controls as described here which basically uses a HttpModule to perform the IoC for Page.

I now want to do the same thing for any UserControls. However there does not appear to be a hook I can use to intercede the IoC for the user control via the page life cycle or elsewhere?

I don't want to follow the approach described in this SO post which advocates a super user control base class that has all the possible interfaces in it.

So any ideas on how I add IoC (property and constructor) to System.Web.UI.UserControl?

0

There are 0 best solutions below