Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Nullable SelectedID of the DropDownList has always a TRUE ModelState although the ID is Null

$
0
0

Sounds like your validators are not being hooked up correctly. The fact that your test passes means that your validator is working, but if ModelState.IsValid is true, then this means the validator is not firing. Make sure that FluentValidation's MVC integration is properly configured, and that your model classes are correctly annotated with the ValidatorAttribute, eg:

[Validator(typepof(MyValidator))]publicclass MyModel { 
}publicclass MyValidator : AbstractValidator<MyModel> {

}

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>