number validation!

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
 
J

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
 
K

Kyle K.

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

-={ Kyle }=-
 

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

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top