Click here to Skip to main content
15,171,993 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to do verification of textbox just after entering data not on button click.
any one having code pls forward it.
thanks in advance.

Inside Updatepanel, use TextChanged event on the TextBox

void textBoxName_TextChanged(object sender, EventArgs e)
//you code here

You can do this using the javascript on 'onblur' event of textbox.

Try something like this:

<asp:textbox id="your_id" runat="server" onblur="your script function" />
Use TextChanged event on TextBox

void textBox1_TextChanged(object sender, EventArgs e)
    //you code for verify
SamWakchaure 6-Sep-12 0:35am
thanks i need only.
you should have write more detail about what you have to verify. for example I have verify the text with text length not less then 8 and not greater then 22. Create one textbox (TB) and one Lable (lB)
here the code:
private void textBox1_TextChanged(object sender, EventArgs e)
            lB.Text = test(tb.Text);
        public string test(string test){
            int a=test.Length;
            if (a > 8  && a<22)
                return "Ok";
                return "Not Valid";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900