title: MVC partial views (or editor templates): append index to input name for multiple use of form?
body: <p>How can I add an index,  to input names and ids in forms that are used multiple times in one view?</p>
  
  <p>I have created a form for photo rotator that provides the ability to edit a context-specific caption for each photo (billboard). I need to be able to include multiple instances of the form fields for this so the admins can edit all of the captions for a rotator's set of photos in one view, and so I need a way to keep  ids and field names unique.</p>
  
  <p>Editor templates automatically add a prefix, but when I loop over the photos like this:</p>
  
  <pre><code>&lt;% foreach (var billboard in Model.Billboards ) {  %&gt;
      &lt;%: Html.EditorFor(x =&gt; billboard, "BillboardForm")%&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <p>It simply adds "billboard_" as the prefix, which doesn't solve my problem.</p>
  
  <p>I'd like to append the <strike>rotator id</strike> billboard id to the end of each input name and id:</p>
  
  <pre><code>&lt;form action="/Rotators/Edit/5" method="post"&gt;                  
      &lt;input id="billboard_21_RotatorId" name="billboard_21_RotatorId" type="hidden" value="5" /&gt; 
      &lt;input id="billboard_21_ImageId" name="billboard_21_ImageId" type="hidden" value="19" /&gt;
      &lt;label for="billboard_21_Title"&gt;Title&lt;/label&gt;
      &lt;textarea cols="20" id="billboard_21_Title" name="billboard_21_Title" rows="2"&gt;Title&lt;/textarea&gt;
      &lt;label for="billboard_21_Caption"&gt;Caption&lt;/label&gt;
      &lt;textarea cols="20" id="billboard_21_Caption" name="billboard_21_Caption" rows="2"&gt;This is the caption&lt;/textarea&gt;
      &lt;select id="billboard_21_TopicId" name="billboard_21_TopicId"&gt;
          &lt;option value="1"&gt;1st option&lt;/option&gt;                   
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Any easy way to do this??</p>