[required(ErrorMessage = "Zip Code is required")] [ZipCode] public string ZipCode { get; set; }
我知道这不起作用,但这正是我要找的.
谁能帮忙
我需要美国的Zip
[required(ErrorMessage = "Zip is required")] [RegularExpression(@"^\d{5}(-\d{4})?$",ErrorMessage = "Invalid Zip")] public string Zip { get; set; }