title: How can I call EditorFor from the controller
body: <p>I have list of locations</p>
  
  <pre><code>public class Location
  {
      public string LocationName { get; set; }
      public string Address { get; set; }
  }
  </code></pre>
  
  <p>I created editor template for this class</p>
  
  <pre><code>&lt;div&gt;
     &lt;span&gt;@Html.TextBoxFor(a =&gt; a.LocationName)&lt;/span&gt;
     &lt;span style="color: red;"&gt;@Html.TextBoxFor(a =&gt; a.Address )&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The problem is that locations load with ajax to my page and then I am going to send the results back to the server.
  But how to get this location with specific index? I mean that for the first location it will generate like this:</p>
  
  <pre><code>&lt;input type="text" name="Locations[0].LocationName" /&gt;
  </code></pre>
  
  <p>For the second location when I press "Add Location" button it should get this location from the server (from action of controller as html string) but with index 1 not 0 because it is next location. </p>
  
  <p>Is it possible to achieve it? Or I am doing something wrong?</p>