Hi,
The other option is to convert all the characters of textbox to ascii
and check whether they are numbers or not.
Here is an example,
string tempString = Textbox1.Text.ToString().Trim();
if ((tempString != "") && (tempString != null))
{
for (int i = 0; i < tempString.ToString().Length; i++)
{
int iAsciiCode = Convert.ToInt32(((int)tempString[i]).ToString());
if (iAsciiCode != 46)
{
if (!((iAsciiCode 47) && (iAsciiCode < 58)))
{
//some message that it should be number
return;
}
}
}
}
Regards,
Mansi Shah.
*** Sent via Developersdex
http://www.developersdex.com ***