Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些常见的网页将在多个 MVC 应用程序中。对于这些页面,我想在不同的 MVC 网站之间重用相同的源代码(控制器 + 视图)。这样做的最佳方法是什么?
ASP.NET MVC 区域似乎是一种可能性,但它们只是网站项目的子目录。是否可以在多个 MVC 应用程序中重用 MVC 区域?
您可以将视图嵌入到程序集中并实现自定义 VirtualPathProvider。
看看“便携式区域”。
http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx