title: ASP.NET MVC 2 Data annotations in a dynamically generated model
body: <p>I am creating an asp.net mvc 2 application generating my view model dynamically depending on user input. Simply put, the user is able to choose which fields he wants to see in his View.</p>
  
  <p>Since the templated helpers rely heavily on model properties and attributes (data annotations), I would need to somehow add the attributes to the view model during runtime. No need to say that this is not a simple task.</p>
  
  <p>So, what do you guys recommend me to do in this scenario? I'm not able to add the attributes statically, so should I go ahead and try to add them dynamically even if it is a lot of work or should I try to use a different approach?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Felipe</p>