显示虽然asp.net页面加载的GIF [英] display a gif while asp.net page loads

查看:271
本文介绍了显示虽然asp.net页面加载的GIF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个lenghty ASP.NET页面加载过程。

I have a lenghty ASP.NET page load process.

有没有显示加载GIF的方式,而ASP.NET页面加载?

Is there a way to display a loading gif while the ASP.NET page loads?

显然,我不能在网页上使用的图像,当我fiirst加载一个虚拟页上的正在加载...的画面,我将用户重定向到真正该页面将立即丢弃网页...

Obviously I can't use an image on the page itself, and when I fiirst load a "dummy page" with the "Loading..." picture, that page is discarded as soon as I redirect the user to the real page...

任何线索?谢谢

推荐答案

您可以使用UpdateProgress控件对于这一点,就像这样:

You can use an UpdateProgress control for this, like this:

<asp:UpdateProgress ID="prgLoadingStatus" runat="server" DynamicLayout="true">
    <ProgressTemplate>
        <div id="overlay">
            <div id="modalprogress">
                <div id="theprogress">
                    <asp:Image ID="imgWaitIcon" runat="server" ImageAlign="AbsMiddle" ImageUrl="/images/wait.gif" />
                    Please wait...
                </div>
            </div>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>  

下面是一些风格,如果你希望它是半透明的,你可以使用:

Here are some styles you can use if you want it to be semi-transparent:

#overlay {
    position: fixed;
    z-index: 99;
    top: 0px;
    left: 0px;
    background-color: #f8f8f8;
    width: 100%;
    height: 100%;
    filter: Alpha(Opacity=90);
    opacity: 0.9;
    -moz-opacity: 0.9;
}            
#theprogress {
    background-color: #fff;
    border:1px solid #ccc;
    padding:10px;
    width: 300px;
    height: 30px;
    line-height:30px;
    text-align: center;
    filter: Alpha(Opacity=100);
    opacity: 1;
    -moz-opacity: 1;
}
#modalprogress {
    position: absolute;
    top: 40%;
    left: 50%;
    margin: -11px 0 0 -150px;
    color: #990000;
    font-weight:bold;
    font-size:14px;
}

这篇关于显示虽然asp.net页面加载的GIF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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