I have a problem with regular expression validation, see If I put the validation in code behind like,
[RegexValidator("[0-9 -]*"
, MessageTemplateResourceName = "INVALID_PHONE"
, MessageTemplateResourceType = typeof(ValidatioinErrors))]
public string Phone
{
get { return phone; }
set { phone = value; }
}
and if I give the value for phone as “080-244408” like this its working but if I give “080-2404408”, that is one extra digit it shows error as “Invalid phone”. What is the reason. can anyone help me, thanks in advance.
Doesn’t look like a problem with your regex. You need to give more information on this. Something else might be wrong in your code.