Try Now
More in this section

Forums / General Discussions / Can Sitefinity run with enableSessionState set to true?

Can Sitefinity run with enableSessionState set to true?

2 posts, 0 answered
  1. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    13 Aug 2010
    16 Feb 2011
    Link to this post
    I have a custom user control that utilizes the Session scope variables. When I included the user control into a page, it threw that familiar exception:

    "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration."

    Is it ok for me to enable session state? Will it affect Sitefinity in any way? Is there a more preferred way for me to persist user control variables through a page refresh?

    Thank you,
    Dan Sorensen
    Web Developer
    ESD 112
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    16 Feb 2011
    Link to this post
    Hello Dan,

    There are properties for each page that allows you to enable the session. You can also use cookies or query string to pass the data when you make a refresh or you want to communicate with anther control.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
2 posts, 0 answered