开发者

Client Side validation in Telerik's MVC Grid

开发者 https://www.devze.com 2022-12-27 06:59 出处:网络
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 ins

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

0

精彩评论

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