Click here to Skip to main content
12,629,886 members (31,387 online)

Response to: to validate for numbers and alphabets in c# asp.net2.0 in codebehind file

Revision 2
Hi, Try this:
bool includesNotOnlyNumeric = Regex.IsMatch(textBox.Text, @"\D");
if (includesNotOnlyNumeric)
{
    // don't show an alert box
}
else
{
    // show an alert box
}
Posted 28-Dec-12 23:18pm by ProgramFOX.
Tags:


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 5 Nov 2009
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid