Home - Forums-.NET - FlyTreeView (ASP.NET) - Error on OnPopulateNodes

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Error on OnPopulateNodes
Link Posted: 28-Aug-2007 11:03
I receive the following error when I try to populate on demand,

\"Object reference not set to an instance of an object. 0|\"

I have a simple page with this content between the form tags,

        
            
                
            
        

This is my code on the page behind,

    Protected Sub FlyTreeView1_PopulateNodes(ByVal sender As Object, ByVal e As NineRays.WebControls.FlyTreeNodeEventArgs) Handles flyTreeView1.PopulateNodes
        Dim node1 As New FlyTreeNode(\"Child 1\")
        Dim node2 As New FlyTreeNode(\"Child 2\")

        node2.PopulateNodesOnDemand = True

        e.Node.ChildNodes.Add(node1)
        e.Node.ChildNodes.Add(node2)

    End Sub

Can you offer any suggestions?
Link Posted: 29-Aug-2007 00:10
I tried to reproduce the error.
So finally I have the following code at ASPX file (FlyTreeView + Button):


    
        
    



And the following code in code-behind ASPX.CS file (same as yours but C#):
protected void flyTreeView1_PopulateNodes(object sender, NineRays.WebControls.FlyTreeNodeEventArgs e)
{
    FlyTreeNode node1 = new FlyTreeNode(\"Child 1\");
    FlyTreeNode node2 = new FlyTreeNode(\"Child 2\");

    node2.PopulateNodesOnDemand = true;

    e.Node.ChildNodes.Add(node1);
    e.Node.ChildNodes.Add(node2);
}


And no problems with this here. Clicking, posting back, etc. No errors.

I checked it with the latest 4.3.1 version.
What exact control version do you use?

Do you have some specific settings for your web app? May be some filters, caching, custom request/response encodings or something like this?

This is very important to us, since you're not the only who experience this problem, and we still cannot duplicate the issue.

Thanks in advance.