Hi
I have written below Annotation on a field . If it is required in another in will have to write it again
. Can we create only once thru class each Annotation separately or some other way so that it can be used in any class
[DataType(DataType.Text)]
[Required(ErrorMessage = "Description can not be blank.")]
[StringLength(25, ErrorMessage = "Max length should be less than or equal to 25.")]
[RegularExpression(@"^[a-zA-Z][a-zA-Z ]+$", ErrorMessage = "Special Characters not allowed")]
[Display(Name = "Description")]
Thanks
Sachin SinghPosted Jun 26, 2021, 7:14 AM
Ramco RamcoPosted Jun 26, 2021, 7:05 AM
Sachin SinghPosted Jun 26, 2021, 6:57 AM
Ramco RamcoPosted Jun 26, 2021, 5:44 AM
Sachin SinghPosted Jun 25, 2021, 11:12 AM