You can handle it inside the TextChanged event of the Textbox . Something like the below code .
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
Code Behind :
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
You can check this article as a reference if you want to check the same in Clientside/Ajax
http://www.aspsnippets.com/Articles/Check-Username-Availability-in-ASP.Net-using-AJAX-PageMethods.aspx[
^]
Hope this helps...