Pages

Men

rh

4/10/2014

Validation for Text Box should accept Numbers in C#

 Name Space : System.Test.RegularExpression;

 
 public bool IsNumeric(string inputString)
        {
            //Regex r = new Regex("^[a-zA-Z0-9,.]+$");
            Regex r = new Regex("^[0-9]+$");
            if (r.IsMatch(inputString))
                return true;
            else
                return false;
        }


No comments :

Post a Comment