Add the following directives in the Web.config file of the Web application between the <system.web> tag and the </system.web> tag:

Session state cannot be used in ASP.NET with Windows SharePoint Services<!-- 
Session state cannot be used in ASP.NET with Windows SharePoint ServicesClear out the WSS ASP.NET handler and specify the default ASP.NET handler for all pages. 
Session state cannot be used in ASP.NET with Windows SharePoint Services
-->
Session state cannot be used in ASP.NET with Windows SharePoint Services
Session state cannot be used in ASP.NET with Windows SharePoint Services
<httpHandlers>
Session state cannot be used in ASP.NET with Windows SharePoint Services
<clear />
Session state cannot be used in ASP.NET with Windows SharePoint Services
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, 
Session state cannot be used in ASP.NET with Windows SharePoint ServicesVersion=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
 />
Session state cannot be used in ASP.NET with Windows SharePoint Services
</httpHandlers>
Session state cannot be used in ASP.NET with Windows SharePoint Services
Session state cannot be used in ASP.NET with Windows SharePoint Services
<!-- 
Session state cannot be used in ASP.NET with Windows SharePoint ServicesSet the trust to Full. WSS configures a very restrictive trust policy that does not 
Session state cannot be used in ASP.NET with Windows SharePoint Servicesallow ASP.NET Web application to run correctly.
Session state cannot be used in ASP.NET with Windows SharePoint Services
-->
Session state cannot be used in ASP.NET with Windows SharePoint Services
Session state cannot be used in ASP.NET with Windows SharePoint Services
<trust level="Full" originUrl="" />
Session state cannot be used in ASP.NET with Windows SharePoint Services
Session state cannot be used in ASP.NET with Windows SharePoint Services
<!-- 
Session state cannot be used in ASP.NET with Windows SharePoint ServicesEnable the session module. This can also be enabled on the WSS Web.config, 
Session state cannot be used in ASP.NET with Windows SharePoint Servicesbut is not enabled by default. If you receive the following message:
Session state cannot be used in ASP.NET with Windows SharePoint ServicesParser Error Message: The module 'Session' is already in the application 
Session state cannot be used in ASP.NET with Windows SharePoint Servicesand cannot be added again. You can remove the following 
Session state cannot be used in ASP.NET with Windows SharePoint Services<httpModules></httpModules> section as session is already enabled 
Session state cannot be used in ASP.NET with Windows SharePoint Serviceson the virtual server. 
Session state cannot be used in ASP.NET with Windows SharePoint Services
--> 
Session state cannot be used in ASP.NET with Windows SharePoint Services
Session state cannot be used in ASP.NET with Windows SharePoint Services
<httpModules>
Session state cannot be used in ASP.NET with Windows SharePoint Services
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
Session state cannot be used in ASP.NET with Windows SharePoint Services
</httpModules> 
Session state cannot be used in ASP.NET with Windows SharePoint Services
Session state cannot be used in ASP.NET with Windows SharePoint Services
<!-- Enable session state for all the pages in the Web application. --> 
Session state cannot be used in ASP.NET with Windows SharePoint Services
<pages enableSessionState="true" enableViewState="true" 
Session state cannot be used in ASP.NET with Windows SharePoint ServicesenableViewStateMac
="true" validateRequest="false" />
Session state cannot be used in ASP.NET with Windows SharePoint Services

The original article .

相关文章: