2
Answers

how to set min 10 number for mobile number validation?

Mani Kandan

Mani Kandan

7y
235
1
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)