Client-side custom data annotation validation

前端 未结 3 473
耶瑟儿~
耶瑟儿~ 2020-12-30 15:02

I\'ve create a custom data annotation to do some validation on my view model. The problem is that it doesn\'t validate on the client-side. Here\'s my model:

         


        
3条回答
  •  攒了一身酷
    2020-12-30 15:07

    Implementing Iclientvalidatable only adds unobtrusive attributes to generated html inputs. To enable validation on client side you must write validators that use these unobtrusive attributes to validate the inputs. Here you can find very good explanation of client and server validation in asp.net mvc 3

提交回复
热议问题