title: Returning an EditorTemplate as a PartialView in an Action Result
body: <p>I have a model similar to this:</p>
  
  <pre><code>public class myModel 
  {
      public ClassA ObjectA {get; set;}
      public ClassB ObjectB {get; set;}
  }
  </code></pre>
  
  <p>In my main view, I have tags similar to this:</p>
  
  <pre><code>&lt;div id="section1"&gt;
      &lt;%=Html.EditorFor(m =&gt; m.ObjectA)%&gt;
  &lt;/div&gt;
  &lt;div id="section2"&gt;
      &lt;%=Html.EditorFor(m =&gt; m.ObjectB)%&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>ClassA and ClassB both have Editor templates defined.</p>
  
  <p>I created some JavaScript that makes an Ajax call to reload the section1 div.  I want the action method to return the editor for ObjectA, ClassA.ascx that is in the EditorTemplates folder.</p>
  
  <p>I have the following in my Action method:</p>
  
  <pre><code>public ActionResult GetData(int input) 
  {
      // Process input here and create modelData
  
      return PartialView("ClassA", modelData);
  }
  </code></pre>
  
  <p>This gives an error because it cannot find the ClassA view.</p>
  
  <p>My solution has been to create a PartialView in the Views folder called "GetData" and my return renders the GetData view.  The GetData view has only one line of code:</p>
  
  <pre><code>&lt;%=Html.RenderForModel()%&gt;
  </code></pre>
  
  <p>This does work, but I was wondering if there was a way for an action method to return and editor template?</p>