Click here to Skip to main content
13,198,465 members (58,738 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 22:18pm by ProgramFOX.
Tags:


Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 5 Nov 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid