if (((TextBox)(DetailsView1.FindControl("TextBox1"))).Text.ToString().Trim() == "hh") { Response.Write("ok"); }