Whenever I use session variables in webparts in sharepoint the page doesn't load and i get an error. I was adviced to enable them because they may be disabled. Any clue?
+1
A:
By Default the Session State is Disabled in SharePoint. If you look at the Web.Config the you will see that as below.
<pages enableSessionState="false"
You can enable it there. Else you can Enable this at the Page Level.
Kusek
2009-08-14 09:57:53
Thanks man, but which Web.Config file exactly should I modify that in?
Ahmad Farid
2009-08-14 10:01:32
Web.Config file of the SharePoint Site that you are Using. Be selective about enabling the Session in the whole application. Because it will be a extra call for the Pages that dont need the Session. So I would advice that you enable only on the Page where you want the Session.
Kusek
2009-08-14 11:26:22
But still which pages? I mean how can I know those pages on the hard drive? Where are they present and what is its path?
Ahmad Farid
2009-08-14 11:30:35
I am using SmartPart which addes a usercontrol into a webpart in sharepoint.
Ahmad Farid
2009-08-14 11:32:14
I think i found somethign and modified to this but it still makes the same error: <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">
Ahmad Farid
2009-08-14 11:40:27
In your Server follow Start->Run->Type InetMgr->Press Enter->You will get Internet Information Server-> Expand the Tree->Find Web Sites->Find your Web Site . Right Click ->Properties -> Select Home Tab->You see a Local Path Navigate to that Path in the Computer and change that Web Config File
Kusek
2009-08-14 15:57:33
i changed it to "true" but its still not working!
Ahmad Farid
2009-08-17 09:32:21
A:
You have to modify two lines, the first one mentioned by kusek and another one:
Uncomment the following line:
Modify the following line:
Ahmad Farid
2009-08-17 10:14:53
A:
You may also need to add/uncomment the Sessionstate module in your web.config file, under <system.web><httpModules>
:
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
Blakomen
2009-12-01 03:02:57