ASP.NET MVC 3 Web应用程序项目之间交换意见 [英] Sharing views between ASP.NET MVC 3 Web application projects

查看:154
本文介绍了ASP.NET MVC 3 Web应用程序项目之间交换意见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有有很多共同的对象几个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上搜寻了一​​段时间后,我终于找到了<一href="http://$c$cclimber.net.nz/archive/2008/11/14/how-to-call-controllers-in-external-assemblies-in-an-asp.net.aspx">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?

推荐答案

您可能想看看<一href="http://lostechies.com/erichexter/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib/">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.

这篇关于ASP.NET MVC 3 Web应用程序项目之间交换意见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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