There must be something else. I did some performance testing in TreeView and was able to display a complex tree structure containing 5,000 nodes in much less time than 40 seconds. 2000 node is a complex tree, displayed after about 3 seconds in IE8. If you can provide more information about your tree, I can provide further assistance.
, HTML , . , URL, ( ) CSS , .
_nodeCount size:
ASPX TreeView tv:
<asp:TreeView ID="tv" runat="server"></asp:TreeView>
:
private Random _rand = new Random();
private int _nodeCount = 2000;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
var itemCount = 0;
while (itemCount < _nodeCount)
{
var n = new TreeNode("Node " + itemCount.ToString(), itemCount.ToString());
itemCount++;
tv.Nodes.Add(n);
CreateSubItem(n, ref itemCount);
}
}
}
protected void CreateSubItem(TreeNode parent, ref int itemCount)
{
if (_rand.Next(2) == 1 || itemCount > _nodeCount)
{
return;
}
var n = new TreeNode("Child Node " + itemCount.ToString(), itemCount.ToString());
itemCount++;
parent.ChildNodes.Add(n);
CreateSubItem(n, ref itemCount);
CreateSubItem(parent, ref itemCount);
}
7/20
, javascript .NET, . http://weblogs.asp.net/dannychen/archive/2006/01/25/436454.aspx , TreeNode; , .