Sitefinity overwriting HttpContext.Current.Items

Posted by Community Admin on 04-Aug-2018 08:51

Sitefinity overwriting HttpContext.Current.Items

All Replies

Posted by Community Admin on 08-Dec-2011 00:00

I am using Entity Framework for my Custom MembershipProvider, and I like to attach my DataContext to a User Session when possible as per the West Wind article below but Sitefinity is consistently overwriting HttpContext.Current.Items.  Do you have any ideas on why this may be? anything I may do to prevent it? or know of another constantly present object where I may be able to store the DataContext? Once I do finally catch a debug turn where my DataContext is still in HttpContext.Current.Items I get the error "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."

www.west-wind.com/.../Linq-to-SQL-DataContext-Lifetime-Management


Posted by Community Admin on 08-Dec-2011 00:00

Interesting question, we would like to store some of our repositories in http context to cut down on database trips, so we'll be faced with a similar problem.

Posted by Community Admin on 12-Dec-2011 00:00

Hi Viktor and Joseph,

Our custom HTTP handler disposes the .Items collection at the end of the request. You could use the Session object instead. I'm not sure how exactly do you use the Context.Items collection in your case, so code would help.

Greetings,
Lubomir Velkov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed