0

I would like to know what is best way to mix this two validation technologies and if is it possible.

If i only use jquery validation I will loose server validation, but i don´t want to repeat same validation rule in the server.

I have read this topic

jQuery Validation plugin and ASP.NET validators Web Forms

but in the end, the solution of mixing the two technologies was undone and the code was simply adapted to highlight the text box with css

thanks a lot.

5
  • 1
    if you use ASP.NET WebForms validation you get client-side and server-side validation automatically. If you want to extend it, you use a CustomValidator control. You still have to write client- and server-side validation for that specific rule, but you don't lose all the rest of the facilities of the standard validators (e.g. RequiredField) etc. Commented Jan 29, 2018 at 12:09
  • jQuery Validate is integrated nicely with MVC, but not with WebForms. The design patterns are fundamentally different and it would be difficult to use jQuery validate with WebForms since there's only ever one HTML form tag on the page, no matter how many logical "forms" you might have. And since jQuery Validate operates on submission of a HTML form, it's really hard to make it only validate the things you need, and then there's the problem of integrating it into ASP.NET's JS-based postback mechanism. All in all, a pain in the wotsit. My advice - just use CustomValidators Commented Jan 29, 2018 at 12:10
  • Thank you very much. But I use many jquery manipulation, for example, show modal bootstrap windows than i implement dynamically, and validate fields that include on it.. and then force __doPostback mechanism... I do this dynamic validation whith jquery validation too Commented Jan 29, 2018 at 12:35
  • Well, my suggestion is that you don't do that, but if you have too much time invested in it already then maybe you should keep it. If you want to do that, then you have to write and integrate your own server-side validation. There's no way round that with either mechanism, it's just easier to integrate it when using CustomValidators. Commented Jan 29, 2018 at 12:37
  • Ok, I understand you, I only would want to know if somebody had found a different solution. Commented Jan 29, 2018 at 12:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.