本文介绍了如何在 Visual Studio 2010 中编辑默认的 Razor Creat/编辑脚手架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以破解 VS2010 MVC 剃刀视图模板中的字段集和图例标签吗?

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

我浏览了 C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE 目录,但找不到我要找的东西.

I've had a bit of a look through the C:\Program Files\Microsoft Visual Studio 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.

MVC razor 视图模板位于:

The MVC razor view templates are located in:

<Visual Studio Installation Path>\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTemplates
\AddView\CSHTML\
  1. 复制 .tt 文件

  1. Copy the .tt files

在您的项目中从 CodeTemplates 开始创建匹配的文件夹树.在这种情况下,您需要创建 \CodeTemplates\AddView\CSHTML\ 并将 .tt 文件粘贴到那里.

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.

这篇关于如何在 Visual Studio 2010 中编辑默认的 Razor Creat/编辑脚手架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 12:07