Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FluentValidation client-side validation

I tried to use GreaterThen validator and it looks like it doesn't support client-side validation. Is there a list of FluentValidation validators which support client-side validation?

like image 201
SiberianGuy Avatar asked Jul 30 '11 13:07

SiberianGuy


People also ask

How do I enable client side validation?

We can enable and disable the client-side validation by setting the values of ClientValidationEnabled & UnobtrusiveJavaScriptEnabled keys true or false. This setting will be applied to application level. For client-side validation, the values of above both the keys must be true.

Is fluent validation client side?

FluentValidation is a server-side library and does not provide any client-side validation directly. However, it can provide metadata which can be applied to the generated HTML elements for use with a client-side framework such as jQuery Validate in the same way that ASP. NET's default validation attributes work.

What is client side validation in asp net?

ASP.NET client side coding has two aspects: Client side scripts : It runs on the browser and in turn speeds up the execution of page. For example, client side data validation which can catch invalid data and warn the user accordingly without making a round trip to the server.

How do you use FluentValidation?

To run the validator, instantiate the validator object and call the Validate method, passing in the object to validate. Customer customer = new Customer(); CustomerValidator validator = new CustomerValidator(); ValidationResult result = validator. Validate(customer);


1 Answers

The list of validators supported on the client is on this page and are as follows:

  • NotNull/NotEmpty (required)
  • Matches (regex)
  • InclusiveBetween (range)
  • CreditCard
  • Email
  • EqualTo (cross-property equality comparison)
  • Length
like image 125
Jeremy Skinner Avatar answered Sep 28 '22 06:09

Jeremy Skinner