title: How to pass model data from view to partial view in loop in MVC
body: <p>I have a view with strongly typed model view and i need to pass this data to a partial view, in loop. (the partial view is sorta playing role of template for data)</p>
  
  <p>Model:</p>
  
  <p>public class Foo
  {</p>
  
  <pre><code>public int Id { get; set; }
  public string Title { get; set; }
  public string Content { get; set; }
  </code></pre>
  
  <p>}</p>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult Index()
      {
          var foo = new List&lt;Foo&gt;();
  
          for (var i = 1; i &lt; 3; i++)
          {
              foo.Add(new Foo{Content = "test content " + i, Title = "test title " + i, Id = i});
          }
          return View(foo);
      }
  </code></pre>
  
  <p>View (Index):</p>
  
  <pre><code>@model List&lt;Project.Models.Foo&gt;
   @foreach (var foo in Model)
      {
          Html.RenderPartial("OneFoo", foo);
      }
  </code></pre>
  
  <p>View (OneFoo):</p>
  
  <pre><code>@using Project.Models
  &lt;div&gt;
      Title:
          @Html.LabelFor(f =&gt; f.Title)
          Content:
          @Html.LabelFor(f =&gt; f.Content)
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>The output I'm getting is: Title: Title, Content: Content - it's not getting the actual values.</p>