ModelState.IsValid returns false for me in my controller. I know that this means that one or more model errors were detected while binding the model. My question is: how do I see errors?
I noticed that my specific ModelState has 6 elements. If I try to do any of this ...
ModelState[0].Errors[0].ToString()
ModelState[0].Errors[0].ErrorMessage
ModelState[0].Value.AttemptedValue
I get this error:
The best overloaded method match for 'System.Web.Mvc.ModelStateDictionary.this[string]' has some invalid arguments
source
share