views:

240

answers:

1

I'd like to implement ASP.Net MVC application which could have controllers, views and content files (like JS, images, ..) assembled dynamically. I'd have a base web project which would contain some basic controllers, views and other content files, but it should be possible to extend/replace all of these items.

The main reason for this kind of architecture is I have a application which should be used by more customers. There're many basic common things which would be same for all the customers, but there're also many things which should behave/look differently for each. Some customers would also have specific functionality which others won't have etc. I know how to solve this problem in Model and Service layer (inheritance + register appropriate services in IoC container), but I don't know where to start with the ASP .Net MVC application.

My basic idea is like there would be some basic project with common controllers, views, JS files etc. There could be also another projects which could replace/add some application parts - controllers, views, JS files, images. I can easily solve controllers by using IoC as a controller provider, but is it possible to "override" views and static files easily somehow? Is VirtualPathProvider magic + put views+static files in reasurces all I need to do to be able to solve this problem?

I'd appreciate any links to blog posts dealing with this and other information sources.

A: 

I cant recommend you to take a look in the improvements made on the Areas feature in ASP.NET MVC 2 and the MvcContrib Portable Areas stuff.

The idea behind is having all the Views embedded with all the Controllers and Models related to that views in a single assembly, so you can have an area of the application "portable".

I think it won't be difficult to "override" the default View placing a replacement in the real web application folder where it should be found.

Marc Climent