ASP.NET MVC 4 Zip Code Validation -


i using asp.net mvc 4 , looking attribute zip code validation

[required(errormessage = "zip code required")] [zipcode] public string zipcode { get; set; } 

i know doesn't work, looking for.

can help

i need zip usa

you need use regex. try this.

[required(errormessage = "zip required")] [regularexpression(@"^\d{5}(-\d{4})?$", errormessage = "invalid zip")] public string zip { get; set; } 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -