spring.net 注入页面

发布于 2024-10-10 02:00:55 字数 566 浏览 0 评论 0原文

想知道是否有人可以帮助将 Spring.net IOC 集成到我的 .aspx 页面中。目前该页面是用控制器设置的,即。 Controller 属性是用这样的对象设置的:

// Create a list of views
var views = new List<IView>() { this.MasterPage, this, this.ucHeader };

// Setup this page with a controller
this.Controller = new Controller(views);

上面的作用是创建一个 Iview 接口列表,该列表由对母版页、当前页面和标题控件的引用组成,这些都继承自 IView。这又被传递给 Controller 对象的构造函数,如上所示。

我现在想摆脱这个并使用 Spring.net 进行 IOC 注入。因此,对于 spring.net,这将通过 xml 文件来实现。我有这个。

我遇到的问题是,我不确定如何创建视图、当前、母版页和 ucHeader 的列表并传递给控制器​​对象。

关于我如何实现上述目标有什么建议吗?

Wondering if someone could help with with some Spring.net IOC integration into a .aspx page I have. At present the page is set up with controller ie. a Controller property is set with an object like so:

// Create a list of views
var views = new List<IView>() { this.MasterPage, this, this.ucHeader };

// Setup this page with a controller
this.Controller = new Controller(views);

What the above does is creates a list of Iview interfaces which is made up with a reference to the master page, current page and a header control which all inherit from IView. This is turn is passed in to the constructor of Controller object as shown above.

I want to move from this now and use Spring.net for IOC injection. Therefore with spring.net this will be achieved with xml files. I have this in place.

The problem I have is that I am not sure how I could about creating a list of the views, current, master page and ucHeader and passing to a Controller object.

Any advice on how I might achieve the above?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文