Git Product home page Git Product logo

Comments (3)

githieu avatar githieu commented on June 30, 2024

I realize that problem is not due to initial visibility of controls but more globally to UpdatePanel refresh.
If a callback causes an UpdatePanel.Update() all ValidatorCalloutExtenders inside no longer works, regardless of they were visible or not.

from ajaxcontroltoolkit.

MikhailTymchukDX avatar MikhailTymchukDX commented on June 30, 2024

Would you please provide a sample project with the described markup so that I can research it?

from ajaxcontroltoolkit.

MikhailTymchukDX avatar MikhailTymchukDX commented on June 30, 2024

This issue happens when unobtrusive validation is enabled and jQuery is present.

ValidatorCallout is placed inside the UpdatePanel, so it is recreated after the panel's update.
However, ValidatorCallout attaches to the existing validator before unobtrusive validation code reevaluates page validators using component's data-val-evaluationfunction attribute, thus reverting the validation function to the default value.

To fix it, we remove the data-val-evaluationfunction attribute from the validator to which ValidatorCallout is attached (see PR #37).
The validator attachment is placed in the Sys.Application.load event handler to ensure it is executed regardless of the page update mode.

To temporarily workaround this issue in v16.1.0, call the ValidatorCallout's _checkPageValidators() method manually:

<ajaxToolkit:ValidatorCalloutExtender
    BehaviorID="ValidatorCalloutBehavior"
    runat="server" />

<script type="text/javascript">
    var firstLoad = true;

    Sys.Application.add_load(function() {

        if(firstLoad)
        {
            firstLoad = false;
            return;
        }

        var behavior = $find("ValidatorCalloutBehavior");
        var element = behavior.get_element();
        element.removeAttribute("data-val-evaluationfunction");
        behavior._checkPageValidators(behavior, element);
    });
</script>

from ajaxcontroltoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.