Hi wxlf960,
Check this example. Now please take its reference and correct your code.
HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server" OnClick="lnk1_Click"
Text='<%# Eval("absentee").ToString() == "1" ?
"<i class=\"fa fa-check\"></i> Yes" :
"<i class=\"fa fa-times\"></i> No" %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] {
new DataColumn("Id"),
new DataColumn("Name"),
new DataColumn("absentee") });
dt.Rows.Add(1, "John Hammond", "1");
dt.Rows.Add(2, "Mudassar Khan", "0");
dt.Rows.Add(3, "Suzanne Mathews", "0");
dt.Rows.Add(4, "Robert Schidner", "1");
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void lnk1_Click(object sender, EventArgs e)
{
}
Screenshot