title: MVC pattern : best way to display an array of elements
body: <p>Suppose I have this div on the <code>view</code> section :</p>
  
  <pre><code>&lt;div class='my class'&gt;
      &lt;%=myVariableToPrint %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>There isnt problems there : I just take from my class/bean (<code>model</code>) my data and put it on a div.</p>
  
  <p>Now, suppose that myVariableToPrint is an array of 10 strings, and I need to print the div 10 times, each div for each string on the array. How can I do it?</p>
  
  <p>Put the div on the model like : </p>
  
  <pre><code>myString+="&lt;div class='my class'&gt;"+myVariable[i]+"&lt;/div&gt;" 
  </code></pre>
  
  <p>and print <code>myString</code> on the <code>view</code> section it's noisy :)</p>
  
  <p>Any solutions?</p>
  
  <p>P.s. I'm speaking about C# there, but should be the same on Java ecc</p>