Html.EditorFor Global Template?

Posted by Grant Trevor on Stack Overflow See other posts from Stack Overflow or by Grant Trevor
Published on 2010-06-10T06:43:38Z Indexed on 2010/06/10 7:12 UTC
Read the original article Hit count: 212

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc-2