Ryan Rivest

  Home :: Contact :: Syndication  :: Login
  8 Posts :: 0 Stories :: 10 Comments :: 0 Trackbacks

Archives

Post Categories

January 2010 Entries

There are quite a few examples of using the attributes from System.ComponentModel.DataAnnotations out there in your ASP.NET MVC applications.  If you haven’t been keeping up with what’s new in ASP.NET MVC 2, one of the biggest improvements is in the area of validation – which is now automatic if you decorate your models with the attributes.  I recommend you check out ScottGu’s latest epic post on the topic to get up to speed. Continuing with the Gu’s example, here is our Person class and the applied validation attributes: public class Person { ...