RegularExpression(@"^\d{1,15}$")]
का उपयोग करना, मैं उपयोगकर्ता 15 लंबाई में है, जो त्रुटि संदेश देता है के लिए अंक दर्ज करना चाहते हैं 'एक संपर्क नंबर के लिए 15 अंक से ऊपर दर्ज करें' यदि यह सही नहीं हैनियमित अभिव्यक्ति त्रुटि संदेश
[Required(ErrorMessage = ("Please enter up to 15 digits for a contact number")), Display(Name = "Contact Number"), RegularExpression(@"^\d{1,15}$")]
public string ContactNumber { get; set; }
उपयोगकर्ता इस पर मुझे त्रुटि संदेश के साथ छोड़ दिया हूँ करने के लिए विफल रहता है:
The field Contact Number must match the regular expression '^\d{1,15}$'.
'Please enter up to 15 digits for a contact number'
के बजाय ... किसी को पता है क्यों? धन्यवाद
मदद लोगों के लिए बहुत धन्यवाद – John