Created
August 22, 2013 10:24
-
-
Save csharpforevermore/6305613 to your computer and use it in GitHub Desktop.
When your Action has the condition "ModelState.IsValid = false", you sometimes need to know what is failing. In this case, use the following to iterate through your MVC errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (ModelState state in ViewData.ModelState.Values.Where(x => x.Errors.Count > 0)) | |
{ | |
var setbreakpointhere = 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment