title: Get values of hidden column for a selected row using jQuery
body: <p>I have a gridview with 1 hidden column and 6 columns. I am trying to get the value of the hidden column row when the user clicks the button within the row but it does not pick up the hidden column. It gets the value of the first column which is the first visible column(FirstName).</p>
  
  <p>Is there a way to get the value of the hidden column(UserID) ?</p>
  
  <p>This is what I have:</p>
  
  <p>C#</p>
  
  <pre><code>&lt;asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="false" class="table table-bordered" ClientIDMode="Static" DataKeyNames="UserID, Firstname" OnRowCommand="gvUsers_RowCommand" OnRowDeleting="gvUsers_RowDeleting"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="UserID" Visible="false" HeaderText="UserID" /&gt;
          &lt;asp:BoundField DataField="FirstName" HeaderText="First Name" /&gt;
          &lt;asp:BoundField DataField="LastName" HeaderText="Last Name" /&gt;
          &lt;asp:BoundField DataField="Username" HeaderText="Username" /&gt;
          &lt;asp:BoundField DataField="Phone" HeaderText="Cellphone Number" SortExpression="EventDescription" /&gt;
          &lt;asp:BoundField DataField="Email" HeaderText="Email" SortExpression="EventDescription" /&gt;
          &lt;asp:TemplateField HeaderText="Action"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Button ID="btnTest" runat="server" Text="Button" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function () {
          $('[id*=btnTest]').on("click", function () {
              var id = $(this).closest("tr").find('td:eq(0)').text();
              alert(id);
              return false;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Please assist how I can get the hidden column value when the button is clicked. Thank you.</p>