Getting the validation metadata for built in validators


Getting the validation metadata for built in validators



How do you get the validation metadata for the built in validation attributes?

I'm trying to implement a word count/character count on a form giving the remaining number allowed. As I am implementing the word count validation and metadata myself (adding it into AdditionalValues) I can access this fine, but having spent ages looking I can't find where to get maximumLength from the StringLength attribute.


WebDev.WebServer.EXE hangs

1:

Model Binding to a List in asp.net mvc 2. Found example. Can't find where I'm going wrong
There is no built in way to receive the maxLength from the StringLength attrialthough e. ASP.NET MVC User Control - Where to put the CSS specific to a control? . ajax.actionlink You have to find it manually using reflection, any thing like:. Is ADO.NET Entity Framework (with ASP.NET MVC v2) a viable option when writing custom and contantly updated websites?
foreach( var property in model.GetType() ) {      var stringLengthAttr = property.GetCustomAttrialthough es(typeof(StringLengthAttrialthough e), false).FirstOrDefault() as StringLengthAttrialthough e;       if( stringLengthAttr != null )          return stringLengthAttr.MaximumLength;  } 
How to disable VS compile warning “class or css class is not defined”

84 out of 100 based on 69 user ratings 344 reviews