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.
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?
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.
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?
Have you added runAllManagedModulesForAllRequests="True" to the system.webServer/modules section in web.config?
<modules runAllManagedModulesForAllRequests="True">
Best
Christian
Seems to do the trick! Thanks very much... ;)
@ChrisW: Can you explain this behavior?
I second the request for an explaination of this behavior. It solved some major woes I was having with membership and member login issues!
Same for me! So, what's the trick ;-)?
I believe I learned it from this post: http://our.umbraco.org/forum/developers/extending-umbraco/4433-Accessing-Session-State-in-User-Control
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.
is working on a reply...