ValidatorBase on ASP.NET App

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 04-Feb-2008 14:25:34   

Adapter, Newest Code, VS 2008, C#, AJAX, DevExpress

(HelloWorld App)

I have an LLBLProDataSource bound and working with a DevExpress AJAX grid.

After the grid edits, I handle nicely the LLBLProDataSource .EntityUpdating like this:


        protected void binder_EntityUpdating(object sender, SD.LLBLGen.Pro.ORMSupportClasses.CancelableDataSourceActionEventArgs e)
        {
            SaleEntity entity = e.InvolvedEntity as SaleEntity ;
            //Works fine here
            
        }

I try to attach a Validator to the SaleEntity,but it doesn't seem to attach.


    [DependencyInjectionInfo(typeof(SaleEntity), "Validator", ContextType = DependencyInjectionContextType.Singleton)]
    public class MyValidator: ValidatorBase
    {
        public override bool ValidateFieldValue(IEntityCore involvedEntity, int fieldIndex, object value)
        {
             //Never comes here
            return base.ValidateFieldValue(involvedEntity, fieldIndex, value);
        }
    }

What am I missing?

ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 04-Feb-2008 14:28:10   

Found it:

**Auto-discovery doesn't work in website applications most of the time, so you should define Dependency Injection configuration settings in the web.config file as defined in the Manual discovery through dependencyInjectionInformation sections in the .config file below. You then also should specify the assemblies with the fullName attribute and the assembly's full name, instead of the file name like in the following example.

**