Search code examples
asp.net-mvcasp.net-mvc-5mvc-editor-templates

Is it possible to place EditorTemplates outside the MVC web application project?


Some of my EditorTemplates can be reusable for other solutions. Like Login, ResetPassword etc.

So, instead of place duplicate editor template in ~\Views\Shared\EditorTemplates\ folder under each solution, I would love to place them in a project I can reference for all solutions.

Is it possible to use those partial views that way?


Solution

  • There is a tool called razorgenerator which would allow you to compile your views into a DLL which you could reference in multiple projects

    Or you could always create a nuget package