title: Getting row from hyperlink in Gridview
body: <p>I have a Hyperlink field in a asp.net gridview that runs code behind in an aspx file, like</p>
  
  <pre><code>&lt;asp:GridView ID="gvCoursesList" runat="server"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="Course" HeaderText="Course"&gt;
          &lt;/asp:BoundField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:LinkButton ID="lblSignup" runat="server" Text="Sign Up" OnClick= "lblSignup_Click" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>In my code behind file I have the function:</p>
  
  <pre><code>    protected void lblSignup_Click(object sender, EventArgs e)
      {
      }
  </code></pre>
  
  <p>How do I retrieve the value of the first column from this function.
  I would like to do something like</p>
  
  <pre><code>string course = gvCoursesList.DataKeys[e.RowIndex].Value.ToString();
  </code></pre>
  
  <p>but it's not working.  Any other ideas?</p>