Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8846193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:55:11+00:00 2026-06-14T11:55:11+00:00

I am assigning into a session a RadTreeNode object (i checked from debugger that

  • 0

I am assigning into a session a RadTreeNode object (i checked from debugger that the session is not null). And then i am trying to cast it back to RadTreeNode object with the following code.

 RadTreeNode node = new RadTreeNode();
      node =  (RadTreeNode)Session["nextNode"] as RadTreeNode;

But the node variable still null. Any suggestions ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:55:12+00:00Added an answer on June 14, 2026 at 11:55 am

    There is a good chance that Session[“nextNode”] is null, as eluded to by @Richard in his comment.

    The “as” cast as RadTreeNode will yield a null value if the source object does not convert to the target type. The prefix cast (RadTreeNode) targets a reference type and will not throw an exception when the as RadTreeNode cast fails.

    You’re casting a null value to RadTreeNode and you’re getting what you’re supposed to… a null reference of RadTreeNode.

    Session is generally bad and should be avoided whenever at all possible. My guess is you’re expecting Session to behave one way and its not.

    For example, is RadTreeNode serializable? It’s been a while so I don’t remember how Session handles serializing/deserializing objects but my guess is it will eat any exceptions related to serialization. Admittedly a guess.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm assigning objects to this list of SqlParameter and then trying to execute the
I am trying to display an NSNumber from an array with keys into an
When assigning a type casted array to codeigniter's session, I get this error: A
I know normally that assigning a name attribute to the radio inputs would only
Need some help assigning a mouseover event to display some icons that start out
I'm assigning 12 ImageButtons their own ids and then giving each one of 6
I am reading in an XML file into a Dataset, then adding a new
I have a problem assigning a value to an entity that has a reference.
i have a map Map<id,String> map1= new Map<id,String>(); I am assigning values into this
I've run into a rather interesting problem. The code below generates an array that,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.