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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -