How i do Required If validation by function in MVC5

前端 未结 2 1812
梦谈多话
梦谈多话 2021-01-17 06:08

if email exist by function check i want display error

how i do it?

 [RequiredIf(BL.datafuncs.checkIfExist(email) == true, ErrorMessage = \"email alr         


        
2条回答
  •  时光说笑
    2021-01-17 06:49

    Custom attributes are embedded in the assembly, they are not run time stuff, so you can NEVER put a function inside the attribute argument. I would suggest you do the check in your controller call and perform some action accordingly

提交回复
热议问题