完成更新面板回发后,我们如何执行客户端代码? [英] How can we execute the client code after completing the update panel postback?

查看:54
本文介绍了完成更新面板回发后,我们如何执行客户端代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们点击复选框并在重新获取数据后隐藏加载程序时,我有一个问题是显示加载程序图像。现在,当我们检查复选框时,加载时会加载'divData'。现在,我的场景是这样的divData在updatepanel中,async trigger复选框与它关联。现在我正在显示这样的Loader



I have an issue to show the Loader Image when we click the checkbox and hide the loader after retriving the data .Now the 'divData' will be loaded by the load when ever we check the checkbox.Now my scenario is like this the divData is in updatepanel and async trigger checkbox is associated to it.Now I am Showing the Loader like this

function ShowProgress(displayValue) {

            var modal = $("<div id="divLoading" />");
            modal.addClass("modal");
            modal.css('display', displayValue);
            $('body').append(modal);
            var loading = $(".loading");
            loading.show();
            var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
            var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
            loading.css({ top: top, left: left, display: displayValue });
        }





这里我点击复选框后传递displayValue'inline'。我已编写代码来隐藏将数据绑定到divData后给出的加载程序图像。





here I am passing the displayValue 'inline' when we click the checkbox.I have written code to hide the loader image as given after binding the data to divData.

ClientScript.RegisterClientScriptBlock(Page.GetType(), "Unload", "ShowProgress('none');", True)





现在上面的代码无法隐藏加载器。复选框控件不在另一个updatepanel中。我已经尝试了所有方法。任何人都可以帮我找到解决方案吗?



Now the above code is not working to hide the loader.The checkbox control is not in another updatepanel.I've tried all the ways . Can anyone help me to find a solution?

推荐答案

< div id = divLoading />);
modal.addClass( modal);
modal.css(' display',displayValue);
("<div id="divLoading" />"); modal.addClass("modal"); modal.css('display', displayValue);


' body')。append(modal);
var loading =
('body').append(modal); var loading =


加载)。
loading.show();
var top = 数学 .max(
(".loading"); loading.show(); var top = Math.max(


这篇关于完成更新面板回发后,我们如何执行客户端代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆