srkirkland / DataAnnotationsExtensions

Validation extensions for DataAnnotations, including optional MVC client validation implementations
https://dataannotationsextensions.apphb.com/
BSD 3-Clause "New" or "Revised" License
308 stars 86 forks source link

DataAnnotationsExtensions MVC4 #55

Closed safr0 closed 11 years ago

safr0 commented 11 years ago

Hi, I'm trying to use the DataAnnotationsExtensions MVC nuget package with asp.net mvc4. I'm just wondering is its should be working with DataAnnotations but for some reasons I've having these following errors at run time.

"Validation type names in unobtrusive client validation rules must be unique. The following validation type was seen more than once: dateValidation type names in unobtrusive client validation rules must be unique. The following validation type was seen more than once: date"

I'm using it my models like... [Date] [ConditionalRequired("ProjectStatus")] public DateTime ProjectCommencementDate { get; set; }

    [Date]
    [ConditionalRequired("ProjectStatus")]
    public DateTime ProjectCompletionDate { get; set; }

Can somebody guide me what I'm doing wrong here.

safr0 commented 11 years ago

sorry just got it right i think these attributes are probably meant to be used with strings only. I removed them from DateTime and now it works alright.