treeview使用foreach概念加载很长时间 [英] treeview is loading long time using foreach concept

查看:104
本文介绍了treeview使用foreach概念加载很长时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了asp.net treeview,我在树视图中使用foreach概念绑定数据,并且所有节点和图像一次从sqlserver数据库绑定。 500以上的节点数。因此,加载速度非常慢。如何提高加载性能或任何其他加载速度快的选项。

i have used asp.net treeview and i am binding data and it's images in treeview using foreach concept in code behind language and all nodes and images are binding from sqlserver database at a time. the number of nodes above 500. so, it is loading very slow. how to increase the loading performance or any other option to load fast.

推荐答案

这取决于很多参数,为什么它需要加载太多。你可以试试的东西是使图像尺寸小,我强烈建议你使用 for loop 而不是 foreach loop 。要查看性能差异,请参阅以下链接



C#For vs. Foreach [ ^ ]



如何:提高TreeView的性能 [ ^ ]



问候:笑:
It depends on so many parameters why its taking too much to load.The things you can try is make images small in size and i strongly recommend you to make use of for loop instead of foreach loop. To have a look at performance differences refer to the link below

C# For vs. Foreach[^]

How to: Improve the Performance of a TreeView[^]

Regards :laugh:


这篇关于treeview使用foreach概念加载很长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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