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.