title: What's the most elegant way of using a partial view to render a comma delimited set of items?
body: <p>I need to render a list of Person objects, say, in a comma delimited format using a Partial View in ASP.NET MVC. My problem is that when rendered using the following code:</p>
  
  <pre><code>&lt;% foreach (var person in Model) { %&gt;
      &lt;%= Html.ActionLink&lt;PersonController&gt;(c =&gt; c.Edit(person.PersonID), Html.Encode(person.Name)) %&gt;,&amp;nbsp;
  &lt;% } %&gt;
  </code></pre>
  
  <p>I get a trailing comma after the last item. What's the most elegant/least stupid way to have this list of persons rendered without the last comma?</p>
  
  <p>My two options so far, in no order, would be:</p>
  
  <ol>
  <li>Use JavaScript to remove the trailing comma on the client side</li>
  <li>Manually create the list using code, instead of markup, in the partial view</li>
  </ol>
  
  <p>Neither of these options appeal to me - any ideas?</p>
  
  <p>Thanks!</p>