Regular Expression Validator and RequiredFieldValidator ???

S

S.Kartikeyan

I have the following problem.
I am using the follwing Regular Expression validator(REV) with validator expressions
^[0-9]{1,2}$
^[a-zA-Z0-9]{3,20}$
The idea of the first exp is 1 or 2 digits
the idea of second expression is username between 3 and 20 chars

When the user enters characters other than the specified REVs are working.
But if the user leaves the textbox without entering anything
Page.IsValid is true which indicates it is not performng any validation.

I read that {n,m} syntax in .net regular expressions is min(n)-max(m)
in the documentation.

Should i also use ReguiredFieldValidator
in addition to regular expression validator

any one facing the same problem.

where is the mistake in me or in .net
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top