Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nikolas van Etten 202 posts 162 karma points
    Nov 06, 2009 @ 13:16
    Nikolas van Etten
    0

    Problem with sessions (Object reference not set to an instance of an object.) on root node

    I've added a usercontrol to the master template which displays information based on a session.

    When trying to access the root node of my site I get a "Object reference not set to an instance of an object." error. This only occurs when accessing www.mysite.com and not when accessing www.mysite.com/home.aspx which are both the same page.

    Just to make sure the problem is related to the session I have only included the following line in the Page_Load of my usercontrol.

    Response.Write(HttpContext.Current.Session.Count.ToString());

    And it results in the "Object reference..." error. Anyone have a clue why this happens? What's different from loading mysite.com and mysite.com/home.aspx when they both should return the same node?

  • Christian W. Larsen 27 posts 49 karma points
    Nov 06, 2009 @ 17:09
    Christian W. Larsen
    1

    Have you added runAllManagedModulesForAllRequests="True" to the system.webServer/modules section in web.config?

    <modules runAllManagedModulesForAllRequests="True">

    Best
    Christian

  • Nikolas van Etten 202 posts 162 karma points
    Nov 06, 2009 @ 19:46
    Nikolas van Etten
    0

    Seems to do the trick! Thanks very much... ;)

  • Petr Snobelt 923 posts 1535 karma points
    Nov 06, 2009 @ 23:12
    Petr Snobelt
    0

    @ChrisW: Can you explain this behavior?

  • Amir Khan 1289 posts 2746 karma points
    Apr 20, 2010 @ 00:23
    Amir Khan
    0

    I second the request for an explaination of this behavior. It solved some major woes I was having with membership and member login issues!

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Apr 23, 2010 @ 00:59
    Michael Latouche
    0

    Same for me! So, what's the trick ;-)?

  • Christian W. Larsen 27 posts 49 karma points
    Jun 24, 2010 @ 16:42
  • Jan Fosgerau 65 posts 89 karma points
    Jun 28, 2010 @ 10:47
    Jan Fosgerau
    0

    When i did this it completely bugged out my umbraco ?

    unable to save - said duplicate template.
    and i decided to restart umbraco - unable to start it.

    i removed the
          <modules runAllManagedModulesForAllRequests="True">

    and it worked again - of course i still have the error with object reference.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies