Validate number

  • Thread starter Thread starter Poppy
  • Start date Start date
P

Poppy

I have a text field I want to validate.

It needs to store a number

e.g "23.5", "10000"

Is there any isnum() method in .net.

TIA
 
Here we go
Dim x As String = "1.034"

If IsNumeric(x) Then

TextBox1.Text = "Yes x is Numeric"

End If
 
If you are trying to validate the user's entry into a textbox, you should
consider using the validator web controls. CompareValidator will handle text
fields. Just set its Operator to DataTypeCheck and the Type to "Double".

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
Back
Top