title: ASP.NET MVC Bootstrap dynamic modal content
body: <p>I am using MVC 5 and I have a <code>&lt;button&gt;</code> for each record in the <code>viewModel</code> as follows:</p>
  
  <pre><code>&lt;table class="table table-hover"&gt;
  &lt;tr&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.Questions.Single().QuestionType)
      &lt;/th&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt;model.Questions.Single().Scheme)
      &lt;/th&gt;
  &lt;/tr&gt;
  
  @foreach (var item in Model.Questions)
  {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.QuestionType)
          &lt;/td&gt;
          &lt;td&gt;
              &lt;button type="button" class="btn btn-success btn-sm" data-toggle="modal" data-target="#myModal" &gt;
                  View
              &lt;/button&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p></p>
  
  <p><code>Foreach (Var item in Model.Questions)</code>, there will be a <code>button</code> that opens up a <code>modal</code>. However, I want this <code>modal</code> to load different contents based on the <code>item.id</code> from <code>Model.Questions</code>. How can I do this?</p>