Radtreenode loading to memached

4 posts, 0 answers
  1. Gregory Bergmann
    Gregory Bergmann avatar
    2 posts
    Member since:
    Apr 2010

    Posted 17 Oct 2012 Link to this post

    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
  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 22 Oct 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Developer Developer
    Developer Developer avatar
    2 posts
    Member since:
    Nov 2005

    Posted 05 Dec 2013 Link to this post

    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;
        }
    }
  5. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 06 Dec 2013 Link to this post

    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.
Back to Top