For a string property in MVC3, I’ve created a partial view at ~/Shared/EditorTemplates/String.cshtml and I’ve placed within it the following:
@model System.String
<div class="Input">
@Html.TextBox("", this.Model)
@Html.ValidationMessage("")
</div>
Viewing the result, it looks good. But the label is still showing up. As you can see it’s not included in the partial view, above, so it must be coming from the base view.
How do I override the label output so when I do @Html.EditorForModel(), my string properties will have a customized label?
I ended up creating a custom
Object.cshtmltemplate.