ValidatorCalloutExtender using a BaseValidator inherited class has the TargetControlID does not work....

Last post 02-14-2008 10:22 PM by Jonathan Shen – MSFT. 3 replies.

Sort Posts:

  • ValidatorCalloutExtender using a BaseValidator inherited class has the TargetControlID does not work....

    02-08-2008, 10:55 AM
    • Loading...
    • Luis Simoes
    • Joined on 04-11-2007, 11:07 PM
    • Portugal
    • Posts 38

    Hello,

     I have built a new validator control that will allow to validate a checkboxlist... without ajax it works just fine. But when i try to attach it to a ValidatorCalloutExtender control it gives me an error:

    Line: 2829
    Char: 23

    Sys.ArgumentException: Value must not be null for Controls and Behaviors.
    Parameter Name: element

    Anyone experienced this? Any help?

  • Re: ValidatorCalloutExtender using a BaseValidator inherited class has the TargetControlID does not work....

    02-14-2008, 12:42 AM
    Answer

    Hi Luis,

    Based on the code, if your own ValidatorControl implements the IValidator interface and works individually, it will ok. 

    initialize : function() {
            AjaxControlToolkit.ValidatorCalloutBehavior.callBaseMethod(this, 'initialize');
            var elt = this.get_element();
            //              
            // Override the evaluation method of the current validator
            //
            if(elt.evaluationfunction) {
                this._originalValidationMethod = Function.createDelegate(elt, elt.evaluationfunction);
                this._validationMethodOverride = Function.createDelegate(this, this._onvalidate);
                elt.evaluationfunction = this._validationMethodOverride;           
            }
        }

    Please first make sure that TargetControl's evaluationfunction works here.  As an alternative, you shall use CustomValidator and use its script function to check the CheckBox's state.

    If all these don't work, please post your sample here.If it is a little complex, you'd better post the whole project(your own Validator) somewhere and then I download it. 

    Best regards,

    Jonathan

     

     

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: ValidatorCalloutExtender using a BaseValidator inherited class has the TargetControlID does not work....

    02-14-2008, 8:50 AM
    • Loading...
    • Luis Simoes
    • Joined on 04-11-2007, 11:07 PM
    • Portugal
    • Posts 38

    I am trying to use the code found here:

     http://www.4guysfromrolla.com/webtech/tips/t040302-1.shtml

     with a ValidatorCalloutExtender you can test it and see if you can make it work :( I had no sucess...


    Regards

  • Re: ValidatorCalloutExtender using a BaseValidator inherited class has the TargetControlID does not work....

    02-14-2008, 10:22 PM

    Hi Luis Simoes,

    This extender validates inputs on the server side, please test its live demo.But ValidatorCalloutExtender works on client side.  We suggest that you should use CustomValidator and use its script function to check the CheckBox's state. 

    Best regards,

    Jonathan

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (4 items)
Microsoft Communities
Page view counter