Abhilash J A

Abhilash J A

  • 530
  • 2.4k
  • 600.5k

how to set min 10 number for mobile number validation?

Apr 12 2017 3:09 AM
I am using this regular expression for mobile number,
  1. [Required(ErrorMessage = "Required")]  
  2.        [DataType(DataType.PhoneNumber)]  
  3.        [RegularExpression(@"^[\+\d]+(?:[\d-.\s()]*)$", ErrorMessage = "Not a valid Mobile number")]  
  4.        public string MobileNumbers { getset; } 
 But not happening validation when enter less than 10 min number.
And for email validation, 
  1. [Required(ErrorMessage = "Required")]  
  2.        [EmailAddress(ErrorMessage = "Invalid Email Address")]  
  3.        public string EmailIDs { getset; } 
But this is not working when enter look like this,
 
 How can I solve this issues? please help me...

Answers (2)