开发者

Poor performance with big tables on explorer 7

开发者 https://www.devze.com 2023-04-06 08:39 出处:网络
I have a table with 2K+ rows in it. In chrome, firefox and IE8,9 it works fine, but in IE 7 the user will have to wait 30s or so...

I have a table with 2K+ rows in it. In chrome, firefox and IE8,9 it works fine, but in IE 7 the user will have to wait 30s or so...

The table开发者_运维技巧 is built using .NET's GridView. According to some reading I've made, setting the width of the cells myself, rather than let the browser calculate it for each TD is better approach, and that what I've done...

What can I do to improve the loading time of the page?

Thanks in advance.


what you should do anyway is add paging and avoid showing 2K records on the same page inside a Grid. This should be done anyway also on the database access level, pointless to query all those rows out of the database, transport them to the web server and render them in the same page. Set up grid paging and limit the page size to something smaller usually between 20 to 100 depends on the context.

For a step by steg guide on how to enable paging, see here:

GridView Examples for ASP.NET 2.0: Paging and Sorting the GridView's Data


Like what Davide suggested, showing 2k rows is alot, and either cutting down that number or using something like http://www.datatables.net/ that can split it into multiple pages or all on one page but only loads the pages you can see.

It also supports async loading, so the users get a mucher better experience

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号