开发者

MVC ModelState not updating

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜