Search code examples
c#asp.net-mvc-3asp.net-mvc-3-areascode-templates

How to specify different AddController code templates for different MVC 3 Areas?


I know how to customize a controller/view template for an MVC project. However, I have a few different MVC 3 Areas in my project and each Area has its own Models, Views and Controllers. Is there a way to specify different code templates for each Area? I tried to place a CodeTemplates folder in one of my Area sub folders but it didn't work.

The idea is, when I right click on any Controller folder in an Area and select Add -> Controller, I want it to use that Area controller template.

UPDATE: I will be happy with being able to select the controller template I want to use, but still wondering if it is possible to specify CodeTemplates for the different areas.


Solution

  • Looks like MVC Scaffolding might be my only option here. I will show specific solution when I get it working.