不需要时进行模型验证的问题? [英] Problem with model validation when it is not required ?

查看:83
本文介绍了不需要时进行模型验证的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的模型中有一个字段,但没有任何必需的数据注释?但当我提交我的表格然后我发现我的modelstate.isvalid是假的?它的解决方案是什么.....但是如果我没有在条件下动态地渲染那个特定的控制,那么它正在工作......并且对于这两种情况我在该字段中分配了相同的值....?

I have a field in my Model but without any required data annotations ? but when i submit my form then i found my modelstate.isvalid is false ? what is the solution for it.....but if i do not render that perticular control dynamically basis on condition then it is working... and for both case i assigned same value in that field....?

推荐答案

这篇关于不需要时进行模型验证的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆