Ramesh
Ramesh

Reputation: 677

Internal works of ASP.NET Validation controls in client and server side

I want to know how ASP.NET validation controls are working (eg: requiredfield validator, regular expression validator). What will really happening when clicking on the button? What are the events are fireing on client side? What really happening internally?

Upvotes: 0

Views: 495

Answers (1)

Boriss Pavlovs
Boriss Pavlovs

Reputation: 1441

When you click on the button (if you you defined CausesValidation="true") button send request to server with __doPostBackWithOptions function aims which contains valiadtion group as parameter (if you defined ValidationGroup property for your button). __doPostBackWithOptions contains function Page_ClientValidate. In this case will be checked all validators which belong for this group. If result (Page_IsValid) will be true postback occures. If You don't define validationGroup (but CausesValidation true) will be checked all validators which is present on page. If defined CAusesValidation false will use _doPostBack function without validators checking. More information here: http://msdn.microsoft.com/en-us/library/aa338815(v=vs.71).aspx and http://msdn.microsoft.com/en-us/library/aa479045.aspx

Upvotes: 1

Related Questions