title: Pass the selected row DataKeyName to a string in a JQuery Modal
body: <p>I have a c# Grdiview, which contains an Hyperlink in the first col. when the user clicks the link, I need the following to happen.</p>
  
  <p>1) Obtain the DataKey Name of the row selected and pass this to a method (code behind), which will build the neccessary data to show in the Model.</p>
  
  <p>2) Present the Model with the data built.</p>
  
  <p>So, I have the Model working, in the sense that I can present a empty one, but I know need assistance with the rest.</p>
  
  <p>I have the following function which doesn't display the value I need</p>
  
  <pre><code>    $(function () {
          $('.view-details').click(function (e) {
              e.preventDefault();
              $('#myModal').modal();
              $('#ticket-id').text("Ticket id: " + $(this).children('td').eq(0).text());
          });
          $('#ticket-tabs a').click(function (e) {
              e.preventDefault();
              $(this).tab('show');
          })
          $('#ticket-tabs a:first').tab('show');
      });
  
   EDIT  &lt;Columns&gt; 
              &lt;asp:TemplateField&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Hyperlink href="#" data-id="1" class="view-details" runat="server"&gt;View details&lt;/asp:Hyperlink&gt;&lt;/td&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;     
               &lt;asp:TemplateField HeaderText="Message Id"&gt;
  
           .
           .
          &lt;/Columns&gt;
  </code></pre>
  
  <p>Once I have the Id, I can then progress trying to populate the data to display</p>