ASP.NET TreeView Tree Performance Issue with IE7.8

I am using treeview in my asp.net application which has 2000 nodes. The tree structure tree takes 40 seconds to load IE7.8, while the same page takes 1 / 10th time on Firefox and chrome. Is there a solution to this problem. I tried to look for it, but found only unanswered questions. If this is a limitation of IE 7.8, then what is the reason for this. This is because of the rendering mechanism. Is there a solution to the problem? I mean, I tried to use the jquery treeview tree, but again it freezes IE and a pop-up warning appears for a slow script.

Please, help.

+5
source share
5 answers

Have you tried this jQuery plugin? http://www.jstree.com/

It supports AJAX loading, which is great for a 2000 node tree.

+3
source

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)
    {
        //create a big tree
        var itemCount = 0;
        while (itemCount < _nodeCount)
        {
            //create a parent item
            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)
{
    //chance that we won't create a sub item
    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; , .

+1

html, , , html, tr td, , , , IE, - , treeview " Render", Div HTML, HTML.

, , , asp.net gridview.

+1

HoverNodeStyle-Cssclass= "nh" TreeView IE9. .

0

All Articles