ASP.NET MVC - 包含的用户控件
我希望能够使用自己的控制器创建 ViewUserControls,以便完全包含所有逻辑。 现在,我必须将 ViewUserControls 与主控制器连接起来,如果我想在其他地方使用这些 viewUserControls,我必须再次连接它们。 是否有可能实现我所希望的事情?
I want to be able to create ViewUserControls with their own controllers so all the logic is contained completely. Right now, I have to wire up the ViewUserControls with the main controller and if I wanted to use these viewUserControls elsewhere, I would have to wire them up again. Is it possible to do what I'm hoping for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的是子控制器。 有传言称它们将出现在 ASP.NET MVC 2 中,但目前还没有更多消息。
现在您可以查看 MVC Contrib 项目。 它支持子控制器。
MvcContrib - 现在支持 ASP.NET MVC 的 SubController
What you are looking for are subcontrollers. There's been talk they will come in ASP.NET MVC 2 but there is no more news on that yet.
Right now you could check out MVC Contrib project. It has support for subcontrollers.
MvcContrib - now with SubController support for ASP.NET MVC