I have a view model, which I have described in a previous question: ASP.net MVC Valid开发者_开发知识库ation 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?
You may find the following blog post helpful.
精彩评论