In ASPX page:
<asp:gridview id="grd" onrowcommand="grd_RowCommand">
<columns>
<asp:templatefield>
<itemtemplate>
<asp:TextBox id="txtName" runat="server" />
<asp:linkbutton id="btn" runat="server" text="Click" commandname="Click" />
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
In Code-Behind
protected void grd_RowCommand(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string name = e.Row.Cells[0].Text;
}
}