Easy way of validating data in webForm textbox?

  • Thread starter Thread starter VMI
  • Start date Start date
V

VMI

Is there an easy way for me to validate what's entered in a webForm
textbox? For example, how can I check that the user only enters a
number (and not letters) in a textbox?
I have VS 2005.
Thanks.
 
To test for a valid floating-point number, use Convert.ToSingle:
if it throws an exception [which you can catch], the number is not
valid.

Colin Williams
 
Hello VMI,

use the standard asp.net validator controls

V> Is there an easy way for me to validate what's entered in a webForm
V> textbox? For example, how can I check that the user only enters a
V> number (and not letters) in a textbox?
V> I have VS 2005.
V> Thanks.
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
Back
Top