This is a migrated thread and some comments may be shown as answers.

Radtreenode loading to memached

3 Answers 50 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Gregory Bergmann
Top achievements
Rank 1
Gregory Bergmann asked on 17 Oct 2012, 12:25 PM
Hello,

I am using Radtreeview and attempting to load radtree nodes to memcached.   I am receiving the following message:

Type 'Telerik.Web.UI.RadTreeNode' in Assembly 'Telerik.Web.UI, Version=2012.2.1002.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable.

I read in related post that the fix would be in the 2012.2.1002.40 nightly build but I am still receiving the error after upgrading.

Thanks

Mike

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 22 Oct 2012, 07:24 AM
Hi Gregory,

Could you provide some sample code in order for us to reproduce your logic on our side and get a better understanding of the issue. Also, could you provide a link to the post you were referencing.
 
Kind regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Developer Developer
Top achievements
Rank 1
answered on 05 Dec 2013, 02:58 PM
Has there been a resolution to this error. I'm getting a similar error with a later version:
System.Runtime.Serialization.SerializationException: Type 'Telerik.Web.UI.RadTreeNode' in Assembly 'Telerik.Web.UI, Version=2013.3.1015.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable. at 

 Below I have provided sample code.  To replicate with the below code the sessionState Mode will have to be set to SqlServer or StateServer.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Task_Test" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager runat="server" ID="radscrptmnger"></telerik:RadScriptManager>
                <telerik:RadTreeView ID="treeAction" runat="server" CheckBoxes="false" Visible="true"
                    Font-Size="11px" BackColor="#FFFFFF" Skin="Sunset" OnNodeClick="TaskTree_NodeClick">
                    <collapseanimation duration="100" type="OutQuint" />
                    <expandanimation duration="100" />
                    <nodes><telerik:RadTreeNode Value="test" Text="test"></telerik:RadTreeNode></nodes>
                </telerik:RadTreeView>
             
        </div>
    </form>
</body>
</html>
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class Task_Test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void TaskTree_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
       Session["SelectedNode"]  = e.Node;
    }
}
0
Bozhidar
Telerik team
answered on 06 Dec 2013, 01:00 PM
Hello,

As the error suggests, the RadTreeNode class is not serializable, and therefore cannot be stored directly into SessionState that requires Serializable objects (which is the case with SqlServer and StateServer modes). 

What I would advice in this scenario is to store the Value of the node, or it's hierrarchical index, and then use this value to get the required node reference.

Regards,
Bozhidar
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TreeView
Asked by
Gregory Bergmann
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Developer Developer
Top achievements
Rank 1
Share this question
or