Vote UpVote

How to Avoid Cut and Paste Code with ASP.NET MVC 2 Model Validation

Craig Stuntz's Weblog – 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; } public string Address1 { get; set; } public string Address2 { get; set; } public string City { get; set; } public string State { get; set; } public string ZIP { get; set; } } Now I would like to add a validation attribute in ...
Favorite? Off-Topic? Craig Stuntz @ 2010-09-28 15:58


Visits: 451
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)