Friday 22 January 2016

Validate TextBox Contain only Alphabets AND Number from C#

public void IsAlphanumeric()
    {
        string strReturn = string.Empty;
        string source = "ADasddasdad";
        Regex pattern = new Regex("[^0-9a-zA-Z]");

        Response.Write(!pattern.IsMatch(source));
    }

No comments: