Ent Lib 3.1 & Ajax Toolkit Integration

Topics: Web Client Software Factory
Nov 26, 2007 at 9:01 AM
Hello there, i'm trying to use the 'PropertyProxyValidator' VAB control along with 'ValidatorCalloutExtender' AjaxToolkit control. It's not working, the validation is occuring on the server & the yellow pop-up baloon is not showing as if no 'ValidatorCalloutExtender' is placed on the page. Do they integrate with each other? or the 'ValidatorCalloutExtender' control doesn't support the 'PropertyProxyValidator' control?

Thanks,
Nov 29, 2007 at 7:17 PM
Hi.

You can add a ServerSideValidationExtender control (from AjaxControlToolkit.WCSFExtensions assembly) included in the Validation Bundle


This Validation Bundle includes an extender control named ServerSideValidationExtender. By using this control, ASP.NET developers can invoke existing server-side validators through an asynchronous callback, without performing a full postback to the server.

The ServerSideValidationExtender control can extend the PropertyProxyValidator control provided by the Validation Application Block. By combining the ServerSideValidationExtender and the Validation Application Block, you can encapsulate validation best practices into easily maintainable code that you can reuse. By using encapsulation, you can separate the application code from the validation logic. A common situation where the Validation Application Block works well is when your validation code must work across multiple layers of the application's architecture.


For more information about the Validation Bundle and ServerSideValidationExtender control, go to here.

Example:
<EntLibValidators:PropertyProxyValidator ID="EmployeeCountPropertyProxyValidator" 
          runat="server" 
          ControlToValidate="EmployeesTextBox" 
          PropertyName="EmployeeCount" 
          RulesetName="ExampleRuleSet"
          SourceTypeName="EntLibSamples.CompanyDetails" 
          EnableViewState="false" />
<AjaxToolkitWCSFExtensions:ServerSideValidationExtender ID="EmployeeCountServerSideValidationExtender"
          runat="server"
          TargetControlID="EmployeeCountPropertyProxyValidator" />
<AjaxToolkit:ValidatorCalloutExtender ID="EmployeeCountValidatorCalloutExtender"
          runat="server"
          TargetControlID="EmployeeCountPropertyProxyValidator" />

Thanks.

Sebastian Iacomuzzi
http://staff.southworks.net/blogs/siacomuzzi