Is there a strongly-named way to remove ModelState errors in ASP.NET MVC

后端 未结 3 1286
一向
一向 2020-12-06 10:33

Is there a way to remove ModelState errors during an ASP.NET MVC postback without having to write each one by hand.

Let\'s say we have a checkbox Billing Same

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 11:20

    If this is for MVC 6, suggest using ModelBindingHelper.ClearValidationStateForModel(Type, ModelStateDictionary, IModelMetadataProvider, string).

提交回复
热议问题