开发者

Changing modelstate using jquery

开发者 https://www.devze.com 2023-03-12 00:56 出处:网络
I have a jquery function. From that I want to change my ModelState state 开发者_StackOverflow社区property into InValid. Is it possible.You cannot, this is done on the server side, OR assign a regular

I have a jquery function. From that I want to change my ModelState state 开发者_StackOverflow社区property into InValid. Is it possible.


You cannot, this is done on the server side, OR assign a regular expression [DataAnnotation] to that value so you can change it on the client side so the server side thinks its invalid. This is best done in your controller method anyways - as javascript from a validation standpoint can easily be forged.

0

精彩评论

暂无评论...
验证码 换一张
取 消