Blast-Dan is partially right, which means that you cannot transfer additional data to your server from the client, except for Key-Value pairs.
However, you can distribute your DataAnnotations to the client so that you do not have to rewrite the verification code. This is not trivial for complex rules, but the Html.EditorFor helpers will help you create input text fields with attached validation attributes that are easily matched using jquery validation and stop form submission. I am thinking of [Required], [Range ()] and [RegularExpression ()] data annotations, to name a few.
You can see a quick example if you just create a normal model and then add a controller to Visual Studio using the wizard to create Views for CRUD operations. You will see how the data annotations that you used in the Model class end up being displayed in the output html.
If you are creating HTML yourself without an HtmlHelper (which I think you can do with a knockout tag), you can check the DataAnnotationsModelValidatorProvider and the IClientValidatable interface starting at this link .
As you can see, this is still uncharted territory tho: /
Tallmaris
source share