where can i see the list of errors of which make the modelstate invalid, i didn't saw any errors property on the modelstate object
The ModelState property on the controller is actually a ModelStateDictionary object. You can iterate through the keys on the dictionary and use the IsValidField method to check if that particular field is valid.
bool hasErrors = ViewData.ModelState.Values.Any(x => x.Errors.Count > 1);
or iterate with
foreach (ModelState state in ViewData.ModelState.Values.Where(x => x.Errors.Count > 0))
{
}
As you are probably programming in Visual studio you'd better take advantage of the possibility of using breakpoints for such easy debugging steps (getting an idea what the problem is as in your case). Just place them just in front / at the place where you check ModelState.isValid and hover over the ModelState. Now you can easily browse through all the values inside and see what error causes the isvalid return false.
About "can it be that 0 errors and IsValid == false": here's MVC source code from http://aspnet.codeplex.com/sourcecontrol/changeset/view/23011?projectName=aspnet#266501
public bool IsValid {
get {
return Values.All(modelState => modelState.Errors.Count == 0);
}
}
Now, it looks like it can't be. Well, that's for ASP.NET MVC v1.