title: MVC 4 Bootstrap Modal Edit \ Detail
body: <p>Hoping someone might be able to help me with something I am experimenting with in MVC 4 using bootstrap.</p>
  
  <p>I have a strongly-typed index view which displays items in a table along with edit and delete action icons in each line.</p>
  
  <pre><code>@model IEnumerable&lt;Models.EquipmentClass&gt;
  
  ....
  
  @foreach (var item in Model)
  {
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;
              @item.ClassId
          &lt;/td&gt;
          &lt;td&gt;
              @item.ClassName
          &lt;/td&gt;
          &lt;td&gt;
              &lt;a href=@Url.Action("Edit", "EquipmentClass", new { id = item.ClassId })&gt;
                  &lt;i class="icon-edit"&gt;&lt;/i&gt;
              &lt;/a&gt;
              &lt;a href=@Url.Action("Delete", "EquipmentClass", new { id = item.ClassId })&gt;
                  &lt;i class="icon-trash"&gt;&lt;/i&gt;
              &lt;/a&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  } &lt;!-- foreach --&gt;
  </code></pre>
  
  <p>The EquipmentClass controller returns the Edit view for the selected item based on the id.  All great and as expected at this point</p>
  
  <pre><code>public ViewResult Edit(int id)
  {
      return View(equipmentclassRepository.Find(id));
  }
  </code></pre>
  
  <p>What I would like to know is how to open the edit form in a bootstrap modal dialog.</p>
  
  <p>I could try and substitute the edit action in the table with the following and then have a modal div at the bottom of the view but how do I pass in the ID of the selected item and which html helper should I use in the modal section?</p>
  
  <pre><code>&lt;!-- replaced table action --&gt;
  &lt;a class="btn pull-right" data-toggle="modal" href="#myModal" &gt;Details&lt;/a&gt;
  
  ....
  
  &lt;!-- modal div --&gt;
  &lt;div class="modal hide fade in" id="myModal" )&gt;
      &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal"&gt;×&lt;/button&gt;
          &lt;h3&gt;Modal header&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          @Html.Partial("Edit")
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;a href="#" class="btn" data-dismiss="modal"&gt;Close&lt;/a&gt;
          &lt;a href="#" class="btn btn-primary"&gt;Save changes&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'd greatly appreciate any advice, many thanks</p>