How to Avoid Cut and Paste Code with ASP.NET MVC 2 Model Validation
In this post, I will demonstrate how to make your own model validation attributes in order to share common validations throughout an ASP.NET MVC application, and which support MVC 2’s client-side validation feature.
Validating a ZIP Code
As an example, consider a model for an address.
public class EditModel
{
public Guid Id { get; set; [...]