在ASPNet中调用PostBack时显示加载图像 [英] Display loading image while PostBack calls in ASPNet

查看:72
本文介绍了在ASPNet中调用PostBack时显示加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我按照这篇文章显示加载网格时加载图片。

在ASP.Net中的PostBack调用时显示加载图像 [ ^ ]



我的页面上有两个按钮。一个用于加载网格,另一个用于下载csv格式的记录。



它适用于加载部分。但如果我下载它继续显示加载图像。我该怎么做才能摆脱这个?



这是功能。正如您在表单上看到的那样,showt showprogress函数被调用。但是对于下载,加载图像不会像填充网格那样消失。



  function  ShowProgress(){
setTimeout( function (){
var modal = $(' < div />');
modal.addClass( modal);
$(' body')。append(modal);
var loading = $( .loading);
loading.show();
var top = 数学 .max($( window )。height()/ 2 - 加载[ 0 ]。offsetHeight / 2 0 );
var left = 数学 .max($( window )。width()/ 2 - 加载[ 0 ]。offsetWidth / < span class =code-digit> 2
0 );
loading.css({top:top,left:left});
}, 200 );
}
$(' form')。live( submit function (){
ShowProgress();
});

解决方案

' < div />');
modal.addClass( modal);


< blockquote>(' body')。append(modal);
var loading =


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


Hello all,
I followed this article to show loading image while the grid loads.
Display loading image while PostBack calls in ASP.Net[^]

I have two buttons on my page . one is for loading the grid and the other is for downloading the records in csv format.

It works fine for the loading part. but if i download it continues to show me the loading image. what should i do to get rid of this ??

this is the function. As you can see on form submitt showprogress function is called. but for download the loading image dosen't disappear as is the case with filling grid.

function ShowProgress() {
        setTimeout(function () {
            var modal = $('<div />');
            modal.addClass("modal");
            $('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 });
        }, 200);
    }
    $('form').live("submit", function () {
        ShowProgress();
    });

解决方案

('<div />'); modal.addClass("modal");


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


(".loading"); loading.show(); var top = Math.max(


这篇关于在ASPNet中调用PostBack时显示加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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