title: How to display a collection in View of ASP.NET MVC Razor project?
body: <p>How to display a collection in View of ASP.NET MVC Razor project?</p>
  
  <p>My Model and View is below. For one person i've to display Many tests on the screen. Thanks in Advance</p>
  
  <pre><code>namespace UI.Models
  {
  public class SuperStudent
  {      
      public string FullName { get; set; }      
  
      public ICollection&lt;TestDetail&gt; CandidateTestDetails { get; set; }
  }
  public class TestDetail
  {
      public DateTime TestDate { get; set; }
      public string RegNum { get; set; }     
  }
  </code></pre>
  
  <p>}</p>
  
  <hr>
  
  <p>View</p>
  
  <pre><code>@model IEnumerable&lt;UI.Models.SuperStudent&gt;
     &lt;p&gt;
        @Html.ActionLink("Create New", "Create")
      &lt;/p&gt;
      &lt;table class="table"&gt;
      &lt;tr&gt;       
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.FullName)
          &lt;/th&gt;     
      &lt;/tr&gt;
      @foreach (var item in Model) {
       &lt;tr&gt;
          &lt;td&gt;
           Print all test details            
          &lt;/td&gt;
      &lt;/tr&gt;
      }
       &lt;/table&gt;
  </code></pre>