title: Pass model item id to jquery function from Html.ActionLink
body: <p>I want to be able to pass the id of each item in below code to jQuery function using Html.ActionLink().</p>
  
  <pre><code>@foreach (var item in Model)
      {
          if (item.AppointmentStatus == "P")
          {   
          &lt;div class="appointment-main-block" role="menuitem" tabindex="20"&gt;
              &lt;div class="appointment-heading"&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Speciality)
              &lt;/div&gt;
              &lt;div class="appointmenttitle"&gt;
                  Date
                 &lt;br /&gt;
                  &lt;br /&gt;
                  Clinician
                 &lt;br /&gt;
                  &lt;br /&gt;
                  Location
              &lt;/div&gt;
              &lt;div class="appointmentdata"&gt;
                  @Html.DisplayFor(modelItem =&gt; item.AppointmentDate)
                  &lt;br /&gt;
                  &lt;br /&gt;
                  @Html.DisplayFor(modelItem =&gt; item.ClinicianName)
                  &lt;br /&gt;
                  &lt;br /&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Location)
              &lt;/div&gt;
  
              &lt;div class="appointmentbutton appointmentbuttonclickable"&gt;
                  View @Html.ActionLink(" ", "Details", "MyAppointments",  new { id = item.AppointmentIdentifier.id }, new { onclick = "getAppointmentRef( item.AppointmentIdentifier.id)" })
                  &lt;br /&gt;
                  &lt;img src="/Content/images/icons/view.png" alt="view icon" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          }
      }
  
  // jQuery - Very Basic for now also considered
  $(".appointmentbutton").click(getAppointmentRef);
      function getAppointmentRef(id) {
                  alert(id);
              }
  </code></pre>
  
  <p>The function is called ok but even if I pass a 'hello' it seems to pass an JSON string none of whose params are the 'id'  i,e. 123456789</p>
  
  <p>How do I make the Actionlink pick up the id for that model item?</p>