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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -