Home - Forums-.NET - FlyTreeView (ASP.NET) - Error - cannot find node

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Error - cannot find node
Link Posted: 26-Jun-2008 22:10
I have treeview on the page. When I expand nodes and then do postback by any other control (e.g. button) then I get the following error:

Cannot find node (na2928a29042d4984a4ff85a919bd4500) in the treeview hierarchy that should handle client-side event: NodeExpandedChanged
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Cannot find node (na2928a29042d4984a4ff85a919bd4500) in the treeview hierarchy that should handle client-side event: NodeExpandedChanged

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Cannot find node (na2928a29042d4984a4ff85a919bd4500) in the treeview hierarchy that should handle client-side event: NodeExpandedChanged]
   NineRays.WebControls.FlyTreeView.ApplyStateLog(String stateLog) +4366
   NineRays.WebControls.FlyTreeView.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +48
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194
Link Posted: 26-Jun-2008 22:12
Typically, this occurs when you change something before or at LoadPostData stage?
Do you somehow handle NodeXXX events and change treeview structure ?
Link Posted: 26-Jun-2008 22:34
I do not change anything before or at LoadPostData.
I do not handle NodeXXX events, but:

EnableViewState on treeview is false (because it renders too much viewstate)
Tree is populated on every postback in Page.OnLoad


P.S. question:
I have large array on every render page with treeview:
*
Is it able to move this large array from page html to external WebResource or something?
Link Posted: 26-Jun-2008 23:14
Its not possible, because this array varies (depending on asp.net settings), so it cannot be just compiled into flytreeview client runtime.

If you disable ViewState, then FlyTreeView cannot apply client-side changes at LoadPostData (it does not have nodes at this moment, and every change is specific to a particular node).
So you need to enable viewstate, if you want treeview to apply post data (that contains client-side changes) to treeview.
Link Posted: 27-Jun-2008 00:31
It is possible, because client script can be generated on the fly.

regarding viewstate: FlyTreeView renders 21Kbytes of unnecessary information (in VIEWSTATE) on the page. But I want my pages to be lightweight.
So what should I do to make it work without viewstate?
I do not need client-side changes at LoadPostData. I just want to disable the error that is displayed.
Link Posted: 27-Jun-2008 00:56
[quote="kinger"]It is possible, because client script can be generated on the fly.

Really? Can you generate WebResouce.axd output on the fly? I think no. We can create a custom HTTP handler to generate script on the fly, but we do not really want to force users to change their web.config in order to make treeview working.

[quote="kinger"]
regarding viewstate: FlyTreeView renders 21Kbytes of unnecessary information (in VIEWSTATE) on the page.

Information is really necessary in case that one need server-side treeview structure reflect client-side changes.

[quote="kinger"]
But I want my pages to be lightweight.
So what should I do to make it work without viewstate?

okay, it looks like we need make changes to FTV to disable ApplyStateLog when EnableViewState is set to false.
This change would not take much time. But just to make sure, do you really need a stateless treeview?
Link Posted: 27-Jun-2008 03:53

Really? Can you generate WebResouce.axd output on the fly? I think no. We can create a custom HTTP handler to generate script on the fly, but we do not really want to force users to change their web.config in order to make treeview working.

OK.


Information is really necessary in case that one need server-side treeview structure reflect client-side changes.
okay, it looks like we need make changes to FTV to disable ApplyStateLog when EnableViewState is set to false.
This change would not take much time. But just to make sure, do you really need a stateless treeview?

Yes I need it, because page size is reduced substantially.
I have page with only treeview, add 100 simple items to it, rendered page size = 140K. It is too much for only treeview. When I turn off viewstate page size becomes 90K (not so good, but 50K lighter)

Please let me know when this update will be available?
Link Posted: 27-Jun-2008 09:00
Already available at Downloads.