本文介绍了对于ModelClientValidationRule ValidationType字符串有效值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么验证规则类型直接可用,lsit无需code一个新的?

Is there a lsit of what validation rule types are directly available, without having to code a new one?

例如

JQuery.validation有分(值)

JQuery.validation has "min(value)"

但我都试过

var rule = new ModelClientValidationRule();
rule.ErrorMessage = ErrorMessage;
rule.ValidationParameters.Add("required", true);
rule.ValidationParameters.Add("min", _minDate);
rule.ValidationType = "min";
yield return rule;

没有成功。

是唯一的选项继承类?

推荐答案

jQuery的文档拍摄,我怀疑你不能使用日期类型,但你的日期转换为一个数字,它可能会工作。

Taken from jquery documentation, I would suspect you cannot use date type but convert your date to a number and it will probably work.

这篇关于对于ModelClientValidationRule ValidationType字符串有效值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 18:52