How to change the standard Razor Creat / Edit forests in Visual Studio 2010

Is there a way I can crack field labels and legends in VS2010 MVC razor view templates?

I looked at the C: \ Program Files \ Microsoft Visual Studio 10.0 \ Common7 \ IDE directory, but cannot find what I'm looking for.

+4
source share
2 answers

If this is specific to your project, then you can make a copy of the default templates for your project and modify them.

MVC razor viewing templates are located in:

<Visual Studio Installation Path>\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTemplates \AddView\CSHTML\ 
  • Copy the .tt files

  • Create the appropriate folder tree in your project, starting with CodeTemplates. In this case, you need to create \ CodeTemplates \ AddView \ CSHTML \ and paste the .tt files there.

  • Now you can edit .tt files as you want. When you create a new view in this project, these templates will be instead of the standard ones from the installation folder. This also works for controller templates, you just need to make sure the tree folder.
+8
source

It looks like you need to download the source for MVC 3.0 and copy the templates that you want to rewrite into the project and make changes there.

0
source

All Articles