Easy way of validating data in webForm textbox?

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.
 
C

Colin Williams

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
 
M

Michael Nemtsev

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top