i have a doubt in validation control (i.e)..the validation controls are executed at client side..but why the validation controls are using the runat='server' attribute..if any boby knows the answer clear my doubt as soon as possible..

Recommended Answers

All 3 Replies

Validations in the Validtion controls are executed at both server side and client side. They are injecting client side validations to the HTML content if javascript is enabled at client browser. If javascript is disabled at client browser, the javascript validations are not executed but the validation will always be executed at server side.

Must be a new feature of .Net 4.0

In .Net 3.5 and older at least all serverside validation must be custom written, only the client side validation is performed. (Or was it the other way around? No I think this is right)

The reason it still needs runat="server" is because it is a .Net xml tag which needs to be processed by the server in order to get the correct client-side HTML.

It allowed both server side and client side validations.
ALlt he validators have this property.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.