开发者

Reuse an MVC area in multiple MVC applications?

开发者 https://www.devze.com 2022-12-30 15:22 出处:网络
I have some common web pages that will be in multiple MVC applications. For those pages I\'开发者_如何转开发d like to reuse the same source code (controllers + views) between the different MVC web sit

I have some common web pages that will be in multiple MVC applications. For those pages I'开发者_如何转开发d like to reuse the same source code (controllers + views) between the different MVC web sites. What is the best way to go about doing this?

ASP.NET MVC areas seem like one possibility but they just a sub directory of the website project. Is it possible to reuse an MVC area in multiple MVC applications?


You could embed views into assemblies and implement a custom VirtualPathProvider.


Look at "portable areas."

http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消