开发者

Resolving dependencies in WebForms UserControls using Structuremap

开发者 https://www.devze.com 2023-01-29 11:50 出处:网络
I\'m currently using a httpmodule to inject my page level permissions using the ObjectFactory.BuildUp() method by structuremap.

I'm currently using a httpmodule to inject my page level permissions using the ObjectFactory.BuildUp() method by structuremap.

I want to do the same thing with webforms user controls. I have a base usercontrol that all my usercontrols inherit. In this I tried to do:

public abstract c开发者_Python百科lass BaseUserControl : System.Web.UI.UserControl
{
    public BaseUserControl()
    {
        ObjectFactory.BuildUp(this);   
    }
}

However, my dependencies are not injected in my derived user controls.

Any ideas as to how I can do this?

0

精彩评论

暂无评论...
验证码 换一张
取 消