Thursday 10 March 2016

Calling Javascript/Jquery on callbacks

JavaScript or JQuery some methods won't work in callback if you are using below it will work

<script type="text/javascript">

             //Initial bind
             $(document).ready(function () {


                 BindControlEvents();
             });

             function BindControlEvents() {

                ////your code here

             }


             //Re-bind for callbacks
             var prm = Sys.WebForms.PageRequestManager.getInstance();

             prm.add_endRequest(function () {
                 BindControlEvents();
             });

    </script>

No comments:

Post a Comment