on button click event try this code its help u.
string name = TextBox2.Text;
bool recordFound = false;
foreach (GridViewRow gvr in GridView1.Rows)
{
Label lbllogin1 = gvr.FindControl("lbllogin") as Label;
if (name == lbllogin1.Text)
{
recordFound = true;
gvr.BackColor = System.Drawing.Color.BlanchedAlmond;
break;
}
}
if (recordFound)
{
Label1.Text = "Record found";
}
else
{
Label1.Text = "Record not found,Please enter correct name";
}