spring.net 注入页面
想知道是否有人可以帮助将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅http://forum.springframework.net/showthread.php?p=21861
See http://forum.springframework.net/showthread.php?p=21861