Using Synchronous PageMethod Custom Validator Control and jQuery calls of ASP.NET AJAX’s PageMethods.
In general Synchronous PageMethod Custom Validator allows to call PageMethods to validate client-side input, and block postbacks if there is an error.
The problem we faced was that we needed to validate large, heavy-wight custom web-form. It also needed to validate separate items and create custom script for each of them. The solution should be integrated into enterprise software that is in production.
The enterprise application we’ve used this control is business process automation software that works in heavy industry manufacturing.
Area of Usage
Synchronous PageMethod Custom Validator can be added directly to any AJAX-enabled website project. We’ve added it to a separate control library project in order to easily put it into toolbox without depending on a compiled version of application.
Originally Synchronous PageMethod Custom Validator Contol was based on:
– Using PageMethods server-side validators on the client-side. The problem there was that the validator was asynchronous, and therefore was very difficult to use in a situation where it was necessary to block a postback if there are any validation errors.
Also we needed to make this solutions cross-browser and make it easy to develop and maintanmece. We decided to use jQuery to call a PageMethod without using the ScriptManager. This is good solution for lightweight client-side communication instead of full ASMX web services.
SoftElegance has successfully used Synchronous PageMethod Custom Validator Control with jQuery calls of ASP.NET AJAX PageMethods to instant validation for web-forms in enterprise class software development project.