I have got a page with number of user controls on it and as a result it takes lot of time to load. I read this article and decided to implement it. Fortunately,
everything worked fine except one problem. One of my user controls reads data from session and that’s where I am getting following exception (previously same code was working fine).
I tried to enable sessionstage (custom mode) in config as wel as at page level but no luck.
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
\\ section in the application configuration.
Please let me know if you know the reason of above exception.
naimish_hit
Member
282 Points
138 Posts
Boost ASP.NET performance with deferred content loading?
Apr 26, 2012 06:23 AM|LINK
Hi,
I have got a page with number of user controls on it and as a result it takes lot of time to load. I read this article and decided to implement it. Fortunately, everything worked fine except one problem. One of my user controls reads data from session and that’s where I am getting following exception (previously same code was working fine).
I tried to enable sessionstage (custom mode) in config as wel as at page level but no luck.
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 \\ section in the application configuration.
Please let me know if you know the reason of above exception.
ND
BrockAllen
All-Star
27522 Points
4901 Posts
MVP
Re: Boost ASP.NET performance with deferred content loading?
Apr 26, 2012 12:50 PM|LINK
Does the containing page have:
<%@ Page EnableSessionState=true %>
Because that's what the error is telling you that is needed.
Maybe in web.config do you have session disabled?
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
cYpH3r x3r0
Member
327 Points
107 Posts
Re: Boost ASP.NET performance with deferred content loading?
May 03, 2012 09:26 AM|LINK
EnableSessionState=true
you can also do this in web.onfig so that you wont have to apply on every page individually, it will be true for all pages