ValidationMessageFor together with AddModelError(key, message). What's the key?

前端 未结 3 1773
暖寄归人
暖寄归人 2020-12-15 07:57

I am developing a client-side and server-side validation for a certain viewModel property.

In the .cshtml file I put this:

@Html.DropDow         


        
3条回答
  •  伪装坚强ぢ
    2020-12-15 08:13

    You want the validation to happen at both the client and server side and also you looking for an elegant solution then why can try creating a custom ValidationAttribute.

提交回复
热议问题