简体   繁体   English

加载GridView的动画

[英]Loading Animation for GridView's

I have a dashboard like interface for the ASP.NET (C#) application I am developing . 我有一个仪表板,例如正在开发的ASP.NET(C#)应用程序的界面。 There are a few GridView's on this page that take awhile to query all the data from the database. 此页面上有一些GridView,需要一些时间才能查询数据库中的所有数据。 The GridView's just display data. GridView只是显示数据。 Is there a way I can load the page and just display a loading icon for each of this GridView's while they load? 有没有一种方法可以加载页面,并在每个GridView加载时仅显示加载图标?

Thanks. 谢谢。

You can try something like the following: 您可以尝试以下操作:

  1. Place all of your GridViews inside of Update Panels 将所有GridView放在更新面板中
  2. Do not bind them on page load 不要在页面加载时绑定它们
  3. Place a timer on the page inside an update panel and set it to trigger 500ms after the page loads 在更新面板内的页面上放置一个计时器,并将其设置为在页面加载后触发500毫秒
  4. Now, bind your GridViews 现在,绑定您的GridViews

Combine the above with the AJAX Toolkit UpdatePanel Animation Extender and you'll have what you're looking for. 将以上内容与AJAX工具包UpdatePanel Animation Extender结合使用 ,您将获得所需的内容。

This will make it appear as if your GridViews are being loaded dynamically AFTER the page loads and your users will see loading icons notifying them. 这将使其看起来就像在页面加载后动态加载GridView一样,并且用户将看到加载图标通知它们。

You can also see a full working (similar) example here . 您还可以在此处查看完整的示例(类似示例)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM