isekaijin
isekaijin

Reputation: 19742

Sharing views between ASP.NET MVC 3 Web application projects

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

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?

Upvotes: 5

Views: 3131

Answers (1)

Russ Cam
Russ Cam

Reputation: 125488

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.

Upvotes: 6

Related Questions