Removing Required Attribute from Class but MVC3 still won't post the form without a value in the text box

前端 未结 2 974
借酒劲吻你
借酒劲吻你 2021-01-12 07:50

I have a class. At one point, I had set the properties of the class to [Required] using System.ComponentModel....

Okay, then I realized this was not needed. I ha

2条回答
  •  天命终不由人
    2021-01-12 08:11

    If you have value type properties. Client validation will always generate required validations. If you don't want required validation for value types make them nullable.

提交回复
热议问题