Home - Forums-.NET - FlyTreeView (ASP.NET) - Strange Behaviour after deploying

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Strange Behaviour after deploying
Link Posted: 16-Jul-2008 00:46
So it all works well when I am debugging, but now I have depolyed it and put it on a test server to see that it functions as I expect.

For some reason the tree is aligned right, the lines connecting the nodes is a bit weird and I get random errors when trying to drag and drop the nodes. These are completely random with what would look like Unique Id's for the nodes.

Please see image below.

Any help on this would be great:


My treeview code:


                                                                            ExpandLevel="2" BorderColor="Silver" BorderWidth="1px" Height="185px" Width="280px"
                                        Padding="2px" DragDropAcceptNames="treeviewnode,dragname" DragDropName="treeviewnode"
                                        EnableFullRowEvents="True" OnInsertCallbackNodesFromValue="flyTreeView2_InsertCallbackNodesFromValue"
                                        OnDropJavascript="flyTreeView2_OnDrop" OnDragOverJavascript="flyTreeView2_OnDragOver"
                                        OnDragOutJavascript="flyTreeView2_OnDragOut" RootDragDropAcceptNames="treeviewnode,dragname"
                                        FadeEffect="true"  OnNodeMoved="flyTreeView2_OnNodeMoved" OnNodeSelected="flyTreeView2_OnNodeSelected"
                                        PostBackOnDropAccept="True" PostBackOnSelect="true">
                                                                                    Padding="2px;3px;3px;1px" RowHeight="18px" />
                                        
                                        
                                    



[EDIT]

This appears to only happen in IE.

[Edit]

An Align tag from a caused the contents within the control to align right.
Link Posted: 16-Jul-2008 02:35
Server Error in '/trunk' Application.
--------------------------------------------------------------------------------

Cannot find node (n6naew3p) in the treeview hierarchy that should handle client-side event: _6g
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 (n6naew3p) in the treeview hierarchy that should handle client-side event: _6g

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 (n6naew3p) in the treeview hierarchy that should handle client-side event: _6g]
   NineRays.WebControls.FlyTreeView.ApplyStateLog(String stateLog) +1150
   NineRays.WebControls.FlyTreeView.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +69
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194




The exception that I was refering to when dragging and dropping nodes.
Link Posted: 16-Jul-2008 05:36
It is definitely something different in your server and debug environment.
You can check the difference by simply comparing page output from to locations.

Thanks.
Link Posted: 16-Jul-2008 21:59
The above was fixed but I am still getting:


Server Error in '/trunk' Application.
--------------------------------------------------------------------------------

Cannot find node (n1tfw7b8) in the treeview hierarchy that should handle client-side event: _6g
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 (n1tfw7b8) in the treeview hierarchy that should handle client-side event: _6g

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 (n1tfw7b8) in the treeview hierarchy that should handle client-side event: _6g]
   NineRays.WebControls.FlyTreeView.ApplyStateLog(String stateLog) +1150
   NineRays.WebControls.FlyTreeView.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +69
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194



On both debug and deployed websites, is there something I am missing here that would be causing this on drag and drop?


[EDIT]

This appears to be due to the fact that I have:


Protected Sub flyTreeView2_OnNodeMoved(ByVal sender As Object, ByVal e As FlyTreeNodeMovedEventArgs)

        If e.Node.Parent Is Nothing Then
            ExecuteSQL("Update Assets Set ParentId = NULL where Id = '" + e.Node.Value + "'")
        Else
            ExecuteSQL("Update Assets Set ParentId = '" + e.Node.Parent.Value + "' where Id = '" + e.Node.Value + "'")
        End If

        Dim formDataSet As DataSet = Nothing
        If e.Node.Value  Nothing Then

            formDataSet = DBHelper(conStr, "SELECT * FROM Assets where Id = '" + e.Node.Value + "'")

            If formDataSet.Tables(0).Rows(0)("ParentId") Is DBNull.Value Then
                tbParentAsset.SelectedValue = tbParentAsset.Items.FindByText("No Parent").Value
            Else
                tbParentAsset.SelectedValue = formDataSet.Tables(0).Rows(0)("ParentId").ToString()
            End If

        End If

    End Sub


If I remove the database stuff it appears to work no worries, I guess the question now is how would I go about safely updating the database when the user drags and drops a node to another parent.
Link Posted: 16-Jul-2008 23:07
The error means, that you somehow modify treeview structure when handling treeview events (NodeMoved, NodeSelected)...
That is why it cannot apply client-side change to server model (error thrown).
Link Posted: 17-Jul-2008 01:43
Cheers