Reputation: 7119
I have a view model, which I have described in a previous question: ASP.net MVC Validation on mutiple controls
My controller action that handles the form post has the field DOB correctly populated however my ModelState object does not thereby causing the validation (which is 'Required') to fail. In here, DOB is null. I have tried outputting DOB as a hidden field in my view however this has not fixed the issue. Is there a proper way to achieve this or could I just edit the ModelState before calling IsValid?
Upvotes: 0
Views: 253