SharePoint 2010 – Enable Session State in SharePoint 2010

יום שני, יוני 20, 2011

When you want to use Session object inside C# or VB.NET Code in SharePoint pages and Web Parts, you receive such error message: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Many people wrote 3 steps, that you need to do for enabling Session State inside SharePoint: 1. Change enableSessionState in page section in system.web inside web.config for your Web Application. <pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7"> 2. Add Session Module in modules section in system.web inside web.config for your Web Application <modules runAllManagedModulesForAllRequests="true"> <remove name="Session" /> <add...
אין תגובות