ModelState.IsValid does not exclude required property

后端 未结 7 1319
猫巷女王i
猫巷女王i 2020-12-06 12:22

Im trying to exclude a required property(Password) so the modelstate dont validate that property, but for some reason it still validate even when i try to exclude it.

<
7条回答
  •  情歌与酒
    2020-12-06 12:51

    I used with success [Bind(Exclude = "Property")] and ModelState.Remove("Property") together, and it worked like charm.

提交回复
热议问题