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 2 中的区域有什么用吗?子区域项目是否可以使用父项目的局部视图或其他方式?
谢谢 !
我会考虑创建一个单独的库——不适合隔离 UI 逻辑——或者一个代码模板——非常像其他 Visual Studio 组件,例如初学者工具包,这样做。在这种情况下,您可以跨项目封装可重用的 UI 组件。
AFAIK 区域用于将一个项目分成不同的部分。