More in this section

Forums / Developing with Sitefinity / Sitefinity overwriting HttpContext.Current.Items

Sitefinity overwriting HttpContext.Current.Items

3 posts, 0 answered
  1. Apptain
    Apptain avatar
    30 posts
    20 Aug 2012
    08 Dec 2011
    Link to this post
    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."

  2. Viktor
    Viktor avatar
    22 posts
    01 Nov 2011
    08 Dec 2011
    Link to this post
    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.
  3. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    03 Nov 2014
    12 Dec 2011
    Link to this post
    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.

    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
3 posts, 0 answered