ASP.NET MVC 3 Web应用程序项目之间交换意见应用程序、意见、项目、NET

2023-09-03 11:33:12 作者:你看我干嘛

我有有很多共同的对象几个ASP.NET MVC 3 Web应用程序:

I have several ASP.NET MVC 3 Web applications that have a lot of common objects:

在相同的登录控制器。其登录系统之间的一些区别被捕获在其的web.config 文件。 在页眉/详细信息视图:发票,付款单,付款单等。 The same login controller. The few differences between their login systems are captured in their web.config files. Header/detail views: invoices, payment orders, payment orders, etc.

为了让我的code少多余的,我感动常见的控制器和视图到一个单独的类库(车型已经在自己的类库)。 Google上搜寻了一​​段时间后,我终于找到了how打电话给控制器的外部组件的,但是,我还是不知道怎么称呼的看法外部组件。我该怎么办呢?

In order to make my code less redundant, I moved common controllers and views to a separate class library (models were already in their own class libraries). After googling for a while, I eventually found out how to call controllers in external assemblies, however, I still don't know how to call views in external assemblies. How do I do that?

推荐答案

您可能想看看MVCContrib便携式地区的。它们允许你编一个完整的MVC应用领域成一个组件,包括控制器,意见和配套文件,如JavaScript和CSS。我已经使他们的广泛使用一个大项目工作,他们的工作很好,特别是与 T4MVC

You may want to look at MVCContrib Portable areas. They allow you to compile an entire MVC application area into one assembly, including controllers, views and supporting files such as JavaScript and CSS. I've worked on a large project that made extensive use of them and they work well, especially combined with T4MVC.