Validation for textbox in asp.net
<p>Am coding in asp.net,i want here validation for textbox.So here want validation for numbers ,ie., instead of characters you enter numbers in textbox then the validator has to popup.Rite now am having <strong>textbox</strong> and one <strong>combobox</strong> and used  <strong>regular expression validator</strong> ,if i enter a numbers in textbox and if i clcik on combobox field,then regular expression validator has to fire by giving message.</p>

<p>So i wrote a code in textchangedevent the below code:</p>

<pre><code>protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
            if (System.Text.RegularExpressions.Regex.IsMatch(TextBox1.Text, "^[a-zA-Z]+$") == false)
            {
                //else if((f_com2.Text, "^[a-zA-Z]+$") == false)
                RegularExpressionValidator1.ValidationGroup.Equals("validator1"); 
                RegularExpressionValidator1.ErrorMessage.Equals("Please enter a valid data");                
            }
            else 
                TextBox1.Enabled=false;
        }
</code></pre>

<p><strong>"Also i changed the properties of textbox,in textchanged event as TextBox1_TextChanged"..</strong></p>

<p>But problem is that it is taking both characters and numbers..
Please do help me..</p>

<p>Thanks and regards</p>

<p>Pradeep.</p>
