unobtrusive client validation using fluentvalidation and asp.net mvc LessThanOrEqualTo not firing

后端 未结 3 1519
花落未央
花落未央 2020-12-02 04:23

I have the following rules

the 1st does work using unobtrusive, client side validation, the second does not

any ideas why?

RuleFor(x => x.         


        
3条回答
  •  北海茫月
    2020-12-02 04:50

    LessThanOrEqualTo and GreaterThanOrEqualTo do not support clientside validation out of the box.

    However, InclusiveBetween is supported. So you could use InclusiveBetween.

    Example

    RuleFor(x => x.StartDate)
        .InclusiveBetween(x.AbsoluteStartDate, x.AbsoluteEndDate)
    

    See the documentation for mor information about supported clientside methods.

提交回复
热议问题