asp.net中的ajax加载器

时间:2010-05-28 10:55:56

标签: c# asp.net ajax

我在asp.net项目c#代码中使用AjaxToolkit。 我的页面中有一个脚本管理和更新面板。一切都很完美。 唯一的问题是我无法弄清楚如何在处理请求时显示Ajax加载器gif。

有什么想法吗?

TY

2 个答案:

答案 0 :(得分:2)

se updateprogress of tool kit:希望这会对你有帮助

<asp:updatepanel id="ResultsUpdatePanel" runat="server">    
<contenttemplate>

<div style="text-align:center;">
    <asp:updateprogress id="UpdateProgress1" runat="server" associatedupdatepanelid="ResultsUpdatePanel" dynamiclayout="true">
                        <progresstemplate>

                           <img src="support/images/loading.gif">

                        </progresstemplate>
                    </asp:updateprogress>

                    </div>

 //your control code
</contenttemplate>
</asp:updatepanel>

答案 1 :(得分:0)

如果你使用Div Loader的某些样式将出现在屏幕的中心..所以它看起来不错。 使用这个

<div style="text-align:center;position:fixed;left:40%;top:40%;padding-top:10px;">
  <asp:updateprogress id="UpdateProgress1" runat="server" associatedupdatepanelid="ResultsUpdatePanel" dynamiclayout="true">
      <progresstemplate>
         <asp:Image ID="LoaderImage" runat="server" ImageUrl="~/images/loading.gif" />
      </progresstemplate>
  </asp:updateprogress>
</div>