Validation of Client fields in ASP . NET MVC 4

Asked

Viewed 663 times

3

I’m needing to do field validations on a system both on the client side and on the server side, on the server side I’ve already been able to do, but I couldn’t find any way to do client side validations on Asp.net MVC 4, someone would have something that could help me?

1 answer

3


The way to do client validation on MVC4 is through the jQuery.Validation:

http://www.nuget.org/packages/jQuery.Validation

The attributes placed in your Model are reflected in the View, and the jQuery.Validation is able to carry out this validation in the View.

Other validation rules can be placed on View through the htmlAttributes do Helper @Html do Razor.

  • Thanks Gypsy Morrison Mendez. Vc would have an example code where the validation is being made ? Ok. thanks again for the help.

  • @Is the answer satisfactory? Then please mark the answer as accepted (V-shaped icon below the reply score) for the benefit of the community. Thank you!

  • 1

    This yes @Gypsy, I will mark as accepted.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.