sharepoint下Session不可用,更改Web.config配置

本文档详细介绍了如何通过修改Web.config文件中的<system.web>标签来配置ASP.NET Web应用程序,包括清除默认的ASP.NET处理器并指定新的处理器、设置完全信任级别、启用会话状态模块及为所有页面开启会话状态等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 Add the following directives in the Web.config file of the Web application between the <system.web> tag and the </system.web> tag:
<!-- Clear out the WSS ASP.NET handler and specify the default ASP.NET handler for all pages. -->
<httpHandlers>
<clear />
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpHandlers>
<!-- Set the trust to Full. WSS configures a very restrictive trust policy that does not allow ASP.NET Web application to run correctly.-->
<trust level="Full" originUrl="" />
<!-- Enable the session module. This can also be enabled on the WSS Web.config, but is not enabled by default. If you receive the following message:Parser Error Message: The module 'Session' is already in the application and cannot be added again. You can remove the following <httpModules></httpModules> section as session is already enabled on the virtual server. -->
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable session state for all the pages in the Web application. -->
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" />

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值