Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

The enablesessionstate attribute on the page directive is not allowed in this page

$
0
0

Hi,

i enabled Session in central administration and also enabled session in web.config file

 

<add name="Session" type="System.Web.SessionState.SessionStateModule" />

<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">

 

 

And tried to implement session in code behind

              Session.Add("testSession", "tst");

                Response.Write("The session value is " + Session["testSession"].ToString());

i am getting the following error :

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.

 

Thanks and Regards

Vinay Kumarss


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>