Reputation: 1062
Is there any way to define a global template for the Html.EditorFor helper?
I would like to alter the markup that is output so that for example instead of rendering
<div class="editor-label">
<label .../>
</div>
<div class="editor-field">
<input .../>
</div>
It would render:
<div>
<div class="label"><label..../></div>
<div class="field"><input..../></div>
</div>
This is for when I'm using Html.EditorFor with an object instance not just an object property.
Upvotes: 4
Views: 562
Reputation: 19228
Brad Wilson has written a blog series on asp.net mvc 2 templates. This one is related to your problem.
Upvotes: 3