title: Using DisplayFor in foreach
body: <p>I want to create a modal box which has the Title of a Product associated to the button next to the Product when clicked.  The data is coming from a database.</p>
  
  <p>I am currently trying to use an integer, which increments on each record in the table, and use this integer to get the record Title.  However, I have been unsuccessful to print the currently iterated product.</p>
  
  <p>I'm using bootstrap stylesheets.</p>
  
  <p>Here is a snippet of my code</p>
  
  <pre><code>     foreach (var item in Products)
        .. display Title, Description, Price, button &amp; modal code 
           &lt;button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal_@i"&gt; View Product&lt;/button&gt;
  
      &lt;div class="modal fade" id="myModal_@i" role="dialog" data backdrop="false"&gt;
     &lt;div class="modal-dialog"&gt;
        &lt;div class="modal-content"&gt;
           &lt;div class="modal-header"&gt;
               &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                 &lt;h4 class="modal-title"&gt;View Product&lt;/h4&gt;
       ---&gt; @Html.DisplayFor(modelItem =&gt; Model.Products.ElementAt(i)) ???? 
  
  
            &lt;/div&gt;
        &lt;div class="modal-body" id="@i"&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>