Client Side validation in Telerik's MVC Grid
Is it possible to add client side validation to the f开发者_StackOverflow社区ields of the Telerik MVC Grid at runtime. I am having validation JSON strings stored in the DB which I need to use when inserting or updating content
Thanks for the clarification in the comments.
By default validation rules are set using data annotation attributes. However I think you can implement custom metadata provider for ASP.NET MVC that applies validation rules at runtime. Perhaps this and this blog posts will be of help.
A more hacky solution would be to generate the JSON for the rules and override the ones output by ASP.NET MVC. Check the output of a page with client-side validation enabled and look for mvcClientValidationMetadata
.
I hope this helps
精彩评论