Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi,

Currently i am using ajax tools for validating textbox, dropdown's etc..

i want to know what are other ways for validating server tags in asp application?

Thanks Advance,

Krishan.....
Posted
Comments
Afzaal Ahmad Zeeshan 26-Jun-15 5:29am    
The server controls are simple HTML elements when rendered in your browser. Don't you know how to validate the data input in HTML elements?
DevilsCod 26-Jun-15 5:42am    
i know the asp tags are rendered as html tags to the server.
And Html tags can be server tags using runat=server attribute.

i know validating html tags using java script and jquery.

i am just asking for is there any new ways of validations for server tags other than ajax.

Validations should ideally be done both at Client side and Server side.

Client side, because for the validations, you don't always need to go to Server side and validate the data, which delays the process. Also Client side validations helps you to alert the user on the go with responsive messages.

Server side, because you can't always reply on Client side as user has the option to disable it on browser side. Sometimes, hackers manipulate the data too. So, to make sure that you are operating on the data intended, you need both type of validations.
 
Share this answer
 
Use the built-in validation controls asp:RequiredField etc. If you have requirements not covered by the built-in ones there is a custom validator where you supply the logic yourself (both client side and server side).

If you want to use a non-standard client framework to validate your controls then you are giving yourself double work as you need to do the server validation separately using a different framework. If you use the built-in framework then you get both client and server validation. Server validation is mandatory, client-side validation is just a "nice to have", anyone can disable it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900