Reply to thread

Put the following function in your code:

[code=csharp]private bool isNum(string str)

{

    try   { int dummy = int.Parse(str); }

    catch { return false; }

    return true;

}[/code]And then you can use

[code=csharp]if (isNum(x.Text))

{

  int num = int.Parse(x.Text);

  if ((num < -1)||(num > 9999999))

  {

    // its valid

  }

}[/code]


Back
Top