Changing modelstate using jquery
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.
精彩评论