title: MVC 4 Html.Editor ignores EditorTemplate
body: <p>I'm trying to implement some custom EditorTemplates but they're only being rendered by my Create view, and not the Edit one.</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class Page {
      public int PageID { get; set; }
      [DataType(DataType.Html)]
      [AllowHtml]
      // I tried including [UIHint("Html")] but this made no difference
      public string Content { get; set; }
      ...
  }
  </code></pre>
  
  <p><strong>/Views/Shared/EditorTemplates/Html.cshtml</strong></p>
  
  <pre><code>@model string
  @Html.TextArea("", Model, new { @class = "html"})
  </code></pre>
  
  <p><strong>/Views/Shared/EditorTemplates/Object.cshtml</strong></p>
  
  <pre><code>@if (ViewData.TemplateInfo.TemplateDepth &gt; 1)
  {
      @ViewData.ModelMetadata.SimpleDisplayText
  
  } else {
  
      @Html.ValidationSummary(false)
  
      foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm =&gt; pm.ShowForEdit
                           &amp;&amp; !ViewData.TemplateInfo.Visited(pm)))
      {
          if (prop.HideSurroundingHtml) {
              @Html.Editor(prop.PropertyName)
              @prop.DataTypeName
          } else {
              &lt;div class="form-field"&gt;
                  @if (!String.IsNullOrEmpty(Html.Label(prop.PropertyName).ToHtmlString())) {
                      @Html.Label(prop.PropertyName)
                  }
                  @Html.Editor(prop.PropertyName)
              &lt;/div&gt;
          }
      }
  }
  </code></pre>
  
  <p><strong>/Views/Page/Create.cshtml</strong> ( This correctly renders <code>Html.cshtml</code> )</p>
  
  <pre><code>@model MvcDisplayTemplates.Models.Page
  
  @using (Html.BeginForm()) {
      @Html.EditorForModel(Model)
      &lt;p&gt;&lt;input type="submit" value="Create" /&gt;&lt;/p&gt;
  }
  </code></pre>
  
  <p><strong>/Views/Page/Edit.cshtml</strong> ( This simply renders the default single line text editor )</p>
  
  <pre><code>@model MvcDisplayTemplates.Models.Page
  
  @using (Html.BeginForm()) {
      @Html.EditorForModel(Model)
      &lt;p&gt;&lt;input type="submit" value="Save" /&gt;&lt;/p&gt;
  }
  </code></pre>
  
  <p>Interestingly, if I use <code>EditorFor</code> on <code>Edit.cshtml</code> then <code>Html.cshtml</code> is actually rendered. e.g.</p>
  
  <pre><code>@Html.EditorFor(model =&gt; model.Content)
  </code></pre>
  
  <p><strong>UPDATE:</strong> If I delete <code>object.cshtml</code> then <code>Html.cshtml</code> is also rendered correctly. So this does seem to be an issue in <code>Object.cshtml</code>. It just seems odd that it works on one view but not another</p>