I have added a StringLenthValidator attribute to the name field of my CSLA business object, with that I am trying to use the AJAX PropertyProxyValidator to server-validate the string inputs for that name field.
I was able to create the control at run-time and it worked fine, but it's not using the PropertyProxyValidator to report the Error Message that I specified in my Business Object attribute, instead it throws an error with the message below:
Object is not valid and can not be saved
.
Code Behind Below:
PropertyProxyValidator ppvNewName = new PropertyProxyValidator();
ppvNewName.PropertyName = "Name";
ppvNewName.ResourceClass = "MyResource";
ppvNewName.SourceTypeName = "SourceType";
ppvNewName.ControlToValidate = "txtNewName";
ppvNewName.Display = Dynamic;
ppvNewName.DisplayMode = List;
AjaxControlToolkit.WCSFExtensions.ServerSideValidationExtender ssve = new AjaxControlToolkit.WCSFExtensions.ServerSideValidationExtender();
ssve.TargetControlID = "ppvNewCategoryName";