title: How to display a list of objects in an MVC View?
body: <p>I have a method that is returning a list of strings. I simply would like to display that list in a view as plain text.</p>
  
  <p><strong>Here's the list from the controller:</strong></p>
  
  <pre><code>public class ServiceController : Controller
  {
  
      public string Service()
      {
          //Some code..........
          List&lt;string&gt; Dates = new List&lt;string&gt;();
          foreach (var row in d.Rows)
          {
              Dates.Add(row[0]);
          }
          return Dates.ToString();
      }
  
      public ActionResult Service()
      {
          Service();
     }
  }
  </code></pre>
  
  <p><strong>And the view:</strong></p>
  
  <pre><code>&lt;table class="adminContent"&gt;
      &lt;tr&gt;
          &lt;td&gt;HEJ&lt;/td&gt;
      &lt;/tr&gt;
       &lt;tr&gt;
          &lt;td&gt;@Html.Action("Service", "Service")&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I figure I must do something in the view like a foreach loop and and reference the list using "@" but how?</p>