views:

1013

answers:

1

I’m using Treeview Control (ASP.NET 2.0) in a web control. The funny thing is, that everything is working fine : expanding, collapse, selecting a node etc. ,but after every click firebug shows an error : TreeView_SelectNode is not defined [Break on this error] HelpFile.aspx (line 1)

The error comes up every time I'm selecting a node. I've been going through System.Web.UI.WebControls assembly and found two places, where TreeView_SelectNode is beeing used.

if ((((this._owner.Page != null) && this._owner.Page.SupportsStyleSheets) && (this.SelectAction == TreeNodeSelectAction.Select)) || (this.SelectAction == TreeNodeSelectAction.SelectExpand))
{
  firstScript = Util.MergeScript(firstScript, "TreeView_SelectNode(" + this._owner.ClientDataObjectID + ", this,'" + this.SelectID + "');");
}

and

if (this._owner.RenderClientScript)
{
  list.Add("onclick");
  list.Add("TreeView_SelectNode(" + this._owner.ClientDataObjectID + ", this,'" + this.SelectID + "');");
}

Anybody has a clue, or ideas what else to do, and where else to look ?

+1  A: 

Alas, I was unable to reproduce your error. Here's the code I'm using for a simplistic example tree view that throws no javascript errors in Firefox.

 <asp:TreeView ID="TreeView1" runat="server" EnableClientScript="true">
  <Nodes>   
   <asp:TreeNode Text="Node One">
    <asp:TreeNode Text="Node One A" />
   </asp:TreeNode>
   <asp:TreeNode Text="Node Two" />
  </Nodes>
 </asp:TreeView>

Can you share the code you're using to help debug this issue further?

Gabe Hollombe