number validation!

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hey

asp.net 2.0

I have a textbox on my webpage. I want to validate that the user has entered
a number and not text. So I added a RegularExpressionValidator to the form,
and set its ControlToValidate to my textbox

I don't find any predefined validation expressions in the "Regular
Expression Editor" which is suitable for this task So I have to create a
custom validation. My problem is that I don't know what to enter in the
"Validation Expression"

The users are suppose to enter their age (years) in this textbox

What validation expression should I use?

Jeff
 
Jeff said:
hey

asp.net 2.0

I have a textbox on my webpage. I want to validate that the user has
entered a number and not text. So I added a RegularExpressionValidator to
the form, and set its ControlToValidate to my textbox

I don't find any predefined validation expressions in the "Regular
Expression Editor" which is suitable for this task So I have to create a
custom validation. My problem is that I don't know what to enter in the
"Validation Expression"

The users are suppose to enter their age (years) in this textbox

What validation expression should I use?

Jeff
 
Since you are using ASP.NET v2.0, try using the RangeValidator. You can
specify a MinimumValue and a MaximumValue.

-={ Kyle }=-
 
Back
Top