<asp:textbox id="txtValidate" runat="server" autopostback="True" xmlns:asp="#unknown">
ontextchanged="txtValidate_TextChanged" /></asp:textbox>
protected void txtValidate_TextChanged(object sender, EventArgs e)
{
string query = "Select * from table where StaffId = " + Convert.ToInt32(txtValidate.Text);
DataTable dtCount = ExecuteQuery(query);
if(dtCount.Count > 0)
true;
else
false;
}
implement code like this. (HTML and Code Behind)