views:

32

answers:

1

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.

+2  A: 

Brad Wilson has written a blog series on asp.net mvc 2 templates. This one is related to your problem.

Adeel
Thanks Adeel exactly what I needed.
Grant Trevor