0

我在转发器中加载图像,但加载需要一些时间我想显示加载图像,直到转发器使用 JavaScript 加载所有图像。有什么帮助吗?

<asp:Repeater ID="rptconvention" runat="server">
    <ItemTemplate>
        <div style="float:left; width:200px;height:180px">                           
            <a title="<%# Eval("Description")%>" href="pop-ups/ViewImage.aspx?lightbox[width]=510&amp;lightbox[height]=450&amp;Imgid=<%#Eval("ID")%>&EventID=<%#hdn_EventID.Value%>&CategoryID=<%#hdn_categorID.Value%>" class="lightbox textColorBlue">        
                <img  src='<%= Settings.FransupportURL %><%# "Convension/images/" & Eval("Img")%>' alt='<%#Eval("Name")%>' Width="180px" Height="120px" style="border:0px;"   />
            </a>
            <div style="text-align:center;float:left; padding-top:5px; width:180px;  font-size:12px;">  
                <%# Functions.StringTruncate_New(Eval("Description"), 25)%>
            </div>           
            <div style="text-align:center;float:left; padding-top:5px; width:180px;  font-size:13px;"> 
               <a style="width: 81px!important;" href="pop-ups/ViewImage.aspx?lightbox[width]=510&amp;lightbox[height]=450&amp;Imgid=<%#Eval("ID")%>&EventID=<%#hdn_EventID.Value%>&CategoryID=<%#hdn_categorID.Value%>" class="lightbox textColorBlue">View</a> | 
               <asp:LinkButton class="textColorBlue"  id="btndownload" CommandName="Download"  CommandArgument='<%#Eval("DownLoadImg")%>' runat="server"   >Download </asp:LinkButton> 
            </div>
        </div>
        <div class="dvSpacingConv"> &nbsp;</div>
    </ItemTemplate>
    <FooterTemplate>

    </FooterTemplate>
</asp:Repeater>
4

2 回答 2

1

If you are willing to wrap your repeater and other controls inside of an UpdatePanel on your page, then you can use the UpdateProgress control, like this:

<asp:UpdateProgress id="updateProgress" runat="server">
    <ProgressTemplate>
        <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
            <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/PathTo/Loading.gif" AlternateText="Loading ..." ToolTip="Loading ..." style="padding: 10px;position:fixed;top:45%;left:50%;" />
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>

Note: If you just want text inside the UpdateProgress control, then substitute a <span> for the <image> and write whatever message you want displayed while the content is loading.

于 2013-09-06T12:43:20.887 回答
0

在此代码中,微调器将在网页中旋转十秒钟..

1.从谷歌下载一个ajax loader.gif。

2.用此代码替换该图像..

3.相应地设置时间..

<div id="spinner" style="display: none;">
<span id="ss" style="float: left; margin-left: 50% !Important; margin-top: 22% !Important;">
<img src="ajax-pink-loader.gif" alt="Loading..." />
</span>
</div>

我已经完成了提交点击,改为将其更改为页面加载..

$("#ssubmit").click(function () {
    $("#spinner").show();
    setInterval(function () {
        $("#spinner").hide();
    }, 10000);
});
于 2013-09-06T12:47:34.493 回答