开发者

How do I edit default Razor Creat/Edit scaffolding in Visual Studio 2010

is there a way I can hack out the fieldset and legend tags in the VS2010 MVC razor view templates?

I've had a bit of a look through the C:\Program Files\Microsoft Visual Studio开发者_Go百科 10.0\Common7\IDE directory but I can't find what I'm looking for.


If it is specific to your project, what you can do is copy the default templates to  your project and modify them.

The MVC razor view templates are located in:

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

  2. Create a matching folder tree in your project starting from CodeTemplates. In this case,  you need to create \CodeTemplates\AddView\CSHTML\ and paste the .tt files there.

  3. Now you can edit the .tt files as you want. When you crete a new view in that project, those templates will  be used instead of the default ones from the installation folder. That also works for the controller templates, you just have to make sure that the folder  tree matches.


Sounds like you'll need to download the source for MVC 3.0 and copy the templates you want to overwrite into you project and make the changes there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜