ASP.NET MVC - 包含的用户控件 [英] ASP.NET MVC - Contained User Controls

查看:164
本文介绍了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?

推荐答案

你所寻找的是子控制器。还有的传言MVC 2他们会在ASP.NET,但没有更多的消息上呢。

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.

现在你可以检查出 MVC的Contrib 项目。它有子控制器的支持。

Right now you could check out MVC Contrib project. It has support for subcontrollers.

MvcContrib - 现在与ASP.NET MVC 子控制器支持

这篇关于ASP.NET MVC - 包含的用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆