0

Subject pretty much says it all - currently working on an application using MVC4 and if I remove a Required attribute from a property in my view model, upon submitting to the controller with this property empty, ModelState.IsValid still returns false citing said property is required.

I have been working around this by calling ModelState.Remove where needed, but this is obviously far from ideal.

I feel this is a pretty straight forward explanation of some rather odd behavior, if I need to provide screenshots and specific code examples I can do so.

Edit:

This is not specific to a certain data type and the solution has been cleaned and rebuilt. I am using LightSpeed ORM but I assume this is completely irrelevant at this level.

mgaughan
  • 875
  • 7
  • 23

0 Answers0