-1

I have been instructed to do server-side and client-side (using a custom jquery script or a jquery validation plug-in and not the built-in validation controls).

I'll figure out the front-end stuff and write a script.

For the server-side validation, should I write my own methods(like for instance write my own required field validator) or should I go with the built-in controls and just call the Page.Validate()?

Thank you very much!

3 Answers 3

0

John,

If you are not using biuld-in validation controls, its better to write validation methods on the server in order to protect the server from vulnerability or from incorrect formats. Your jquery validation methods for some reason could not be executed (for example if the javascript on the client is disabled)

Hope this helps... Muse Extensions

0

There are no asp.net built in controls that has a server side built-in validation functionality.

ASP.NET validation controls validate user's input at client side. However, you can use the CustomValidator control to implement your own validation method either at client side or server side.

0

If validation is being performed on the client-side already, then I would add any server-side validation in the business layer. For this purpose, you may need to resort to custom code in some cases, but data annotations may be very helpful for many of the common validations. If you aren't using a framework that already supports data annotations, it's not difficult to write a bit of code to iterate over your objects and find the fields with these annotations to trigger them.

http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.aspx

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.