是否可以在属性的基础上覆盖MVC View Scaffolding?

时间:2011-06-21 11:47:29

标签: asp.net-mvc-3 razor t4 scaffolding

是否可能基于属性上的属性而不是

<div class="editor-label">
    @Html.LabelFor(model => model.PropertyName)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.PropertyName)
    @Html.ValidationMessageFor(model => model.PropertyName)
</div>

以下获取scaffolded

   <div class="editor-label">
        @Html.LabelFor(model => model.PropertyName)
    </div>
    <div class="editor-field-tall">
        @Html.TextAreaFor(model => model.PropertyName, new { @rows = 5, @cols = 40 })
        @Html.ValidationMessageFor(model => model.PropertyName)
    </div>

没有重写,替换或复制到新的TT然后扩展mvc脚手架模板?

1 个答案:

答案 0 :(得分:0)

  

没有重写,替换或   然后复制到新的TT   扩展mvc脚手架   模板?

没有

如果您想编写自己的mvc脚手架模板,I would read this post which will cover how you can override the T4 templates.