无法使Session State工作 [英] Cannot get Session State to work
问题描述
我已经有一段时间了,并且无法理解。有人可以请求
帮助这条消息吗?
SessionState只能在EnableSessionState设置为true时使用
in配置文件或页面指令。另请确保
System.Web.SessionStateModule或自定义会话状态模块包含在
< configuration>< system.web>< httpModulessection in应用程序
配置。
这是我当前的web.config文件
<?xml version = 1.0?>
<! -
注意:作为手动编辑此文件的替代方法,您可以使用
web管理工具,用于配置应用程序的设置。在Visual Studio中使用
网站 - > Asp.Net配置选项。
完整的设置和注释列表可在
中找到machine.config.comments通常位于
\ Windows \ Microsoft.Net\Framework\v2.x\Config
- >
< configuration xmlns =" http://schemas.microsoft.com/.NetConfiguration/v2.0">
< appSettings>
< add key =" ReportServer"值= QUOT; HTTPS:// MYSERVER /的reportserver /" />
< / appSettings>
< system.web>
<! -
设置编译debug =" true"将调试
符号插入编译页面。因为这个
会影响性能,所以在开发过程中将此值设置为true
- >
< compilation debug =" true">
< assemblies>
< add assembly =" System.Design,Version = 2.0.0.0,Culture =中性,
PublicKeyToken = B03F5F7F11D50A3A" />
< add assembly =" System.Windows.Forms,Version = 2.0.0.0,Culture = neutral,
PublicKeyToken = B77A5C561934E089" />
< / assemblies>
< / compilation>
<! -
< authenticationsection启用配置
的
ASP.NET用来识别传入用户的安全认证模式。 />
- >
<身份验证模式=" Windows">
< forms loginUrl =" Index.aspx"
cookieless =" UseUri" />
< / authentication>
< authorization>
< allow users =" *" />
< / authorization>
<! -
< customErrorssection启用配置
如果/当发生未处理的错误时该怎么办?
在执行请求期间。具体来说,
它使开发人员能够配置html错误页面
来代替错误堆栈跟踪。
- >
< customErrors mode =" Off">
< / customErrors>
< trust level =" Full" originUrl = QUOT;" />
< httpModules>
< add name =" Session" type =" System.Web.SessionState.SessionStateModule" />
< / httpModules>
<! - 为所有人启用会话状态Web应用程序中的页面。 - >
< pages>
< controls>
< add tagPrefix =" ajaxToolkit" namespace =" System.Web.UI"
assembly =" System.Web.Extensions,Version = 1.0.61025.0,Culture = neutral,
PublicKeyToken = 31bf3856ad364e35" />
< add namespace =" AjaxControlToolkit" assembly =" AjaxControlToolkit"
tagPrefix =" ajaxToolkit" />
< / controls>
< / pages>
< /system.web>
< / configuration>
在ASP.NET 2.0中默认启用InProc会话状态在Web.config中根本不需要任何
条目。
--Peter
在每个大型程序中,都有一个小程序试图离开。
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http: //www.blogmetafinder.com
" Wannabe"写道:
我已经有一段时间了,并且无法弄明白。有人可以请求
帮助这条消息吗?
SessionState只能在EnableSessionState设置为true时使用
in配置文件或页面指令。另请确保
System.Web.SessionStateModule或自定义会话状态模块包含在
< configuration>< system.web>< httpModulessection in应用程序
配置。
这是我当前的web.config文件
<?xml version = 1.0?>
<! -
注意:作为手动编辑此文件的替代方法,您可以使用
web管理工具,用于配置应用程序的设置。在Visual Studio中使用
网站 - > Asp.Net配置选项。
完整的设置和注释列表可在
中找到machine.config.comments通常位于
\ Windows \ Microsoft.Net\Framework\v2.x\Config
- >
< configuration xmlns =" http://schemas.microsoft.com/.NetConfiguration/v2.0">
< appSettings>
< add key =" ReportServer"值= QUOT; HTTPS:// MYSERVER /的reportserver /" />
< / appSettings>
< system.web>
<! -
设置编译debug =" true"将调试
符号插入编译页面。因为这个
会影响性能,所以在开发过程中将此值设置为true
- >
< compilation debug =" true">
< assemblies>
< add assembly =" System.Design,Version = 2.0.0.0,Culture =中性,
PublicKeyToken = B03F5F7F11D50A3A" />
< add assembly =" System.Windows.Forms,Version = 2.0.0.0,Culture = neutral,
PublicKeyToken = B77A5C561934E089" />
< / assemblies>
< / compilation>
<! -
< authenticationsection启用配置
的
ASP.NET用来识别传入用户的安全认证模式。 />
- >
<身份验证模式=" Windows">
< forms loginUrl =" Index.aspx"
cookieless =&quo吨; UseUri" />
< / authentication>
< authorization>
< allow users =" *" />
< / authorization>
<! -
< customErrorssection启用配置
如果/当发生未处理的错误时该怎么办?
在执行请求期间。具体来说,
它使开发人员能够配置html错误页面
来代替错误堆栈跟踪。
- >
< customErrors mode =" Off">
< / customErrors>
< trust level =" Full" originUrl = QUOT;" />
< httpModules>
< add name =" Session" type =" System.Web.SessionState.SessionStateModule" />
< / httpModules>
<! - 为所有人启用会话状态Web应用程序中的页面。 - >
< pages>
< controls>
< add tagPrefix =" ajaxToolkit" namespace =" System.Web.UI"
assembly =" System.Web.Extensions,Version = 1.0.61025.0,Culture = neutral,
PublicKeyToken = 31bf3856ad364e35" />
< add namespace =" AjaxControlToolkit" assembly =" AjaxControlToolkit"
tagPrefix =" ajaxToolkit" />
< / controls>
< / pages>
< /system.web>
< / configuration>
不确定你的意思,但我的web.config中没有InProc条目
文件。
Peter Bromberg [C#MVP]" ;写道:
默认情况下在ASP.NET 2.0中启用InProc会话状态您在Web中根本不需要任何
条目。配置。
- 彼得
在每个大型程序中,都有一个小程序试图离开。
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
" Wannabe"写道:
我已经有一段时间了,并且无法弄明白。有人可以请求
帮助这条消息吗?
SessionState只能在EnableSessionState设置为true时使用
in配置文件或页面指令。另请确保
System.Web.SessionStateModule或自定义会话状态模块包含在
< configuration>< system.web>< httpModulessection in应用程序
配置。
这是我当前的web.config文件
<?xml version = 1.0?>
<! -
注意:作为手动编辑此文件的替代方法,您可以使用
web管理工具,用于配置应用程序的设置。在Visual Studio中使用
网站 - > Asp.Net配置选项。
完整的设置和注释列表可在
中找到machine.config.comments通常位于
\ Windows \ Microsoft.Net\Framework\v2.x\Config
- >
< configuration xmlns =" http://schemas.microsoft.com/.NetConfiguration/v2.0">
< appSettings>
< add key =" ReportServer"值= QUOT; HTTPS:// MYSERVER /的reportserver /" />
< / appSettings>
< system.web>
<! -
设置编译debug =" true"将调试
符号插入编译页面。因为这个
会影响性能,所以在开发过程中将此值设置为true
- >
< compilation debug =" true">
< assemblies>
< add assembly =" System.Design,Version = 2.0.0.0,Culture =中性,
PublicKeyToken = B03F5F7F11D50A3A" />
< add assembly =" System.Windows.Forms,Version = 2.0.0.0,Culture = neutral,
PublicKeyToken = B77A5C561934E089" />
< / assemblies>
< / compilation>
<! -
< authenticationsection启用配置
的
ASP.NET用来识别传入用户的安全认证模式。 />
- >
<身份验证模式=" Windows">
< forms loginUrl =" Index.aspx"
Cookie的= QUOT; UseUri" />
< / authentication>
< authorization>
< allow users =" *" />
< / authorization>
<! -
< customErrorssection启用配置
如果/当发生未处理的错误时该怎么办?
在执行请求期间。具体来说,
它使开发人员能够配置html错误页面
来代替错误堆栈跟踪。
- >
< customErrors mode =" Off">
< / customErrors>
< trust level =" Full" originUrl = QUOT;" />
< httpModules>
< add name =" Session" type =" System.Web.SessionState.SessionStateModule" />
< / httpModules>
<! - 为所有人启用会话状态Web应用程序中的页面。 - >
< pages>
< controls>
< add tagPrefix =" ajaxToolkit" namespace =" System.Web.UI"
assembly =" System.Web.Extensions,Version = 1.0.61025.0,Culture = neutral,
PublicKeyToken = 31bf3856ad364e35" />
< add namespace =" AjaxControlToolkit" assembly =" AjaxControlToolkit"
tagPrefix =" ajaxToolkit" />
< / controls>
< / pages>
< /system.web>
< / configuration>
re:
!不确定你的意思,但我没有InProc条目web.config文件。
InProc *也是默认值。
如果要禁用SessionState *或*启用不同的sessionState
管理模式,除了InProc,你需要明确设置这些选项。
检查是否:
< section name =" sessionState" type =" System.Web.Configuration.SessionStateSection,System.Web,
Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a" allowDefinition的= QUOT; MachineToApplication" />
....在你的machine.config文件中...它应该在那里。
Juan T. Llibre ,asp.net MVP
asp.net faq: http:/ /asp.net.do/faq/
foros de asp.net,en espa?ol: http://asp.net.do/foros/
=============== =======================
" Wannabe" < Wa ***** @ discuss.microsoft.com写信息
新闻:FF *********************** *********** @ microsof t.com ...
不确定你的意思,但我没有InProc条目我的web.config
档。
" Peter Bromberg [C#MVP]"写道:
>在ASP.NET 2.0中默认启用InProc会话状态您在Web.config中根本不需要任何
条目。
- 彼得
在每个大型程序中,都有一个小程序试图离开。
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
Wannabe写道:
我已经有一段时间了,并且无法弄明白。有人可以请求
帮助这条消息吗?
SessionState只能在EnableSessionState设置为true时使用
in配置文件或页面指令。另请确保
System.Web.SessionStateModule或自定义会话状态模块包含在
< configuration>< system.web>< httpModulessection in应用程序
配置。
这是我当前的web.config文件
<?xml version = 1.0?>
<! -
注意:作为手动编辑此文件的替代方法,您可以使用
web管理工具,用于配置应用程序的设置。在Visual Studio中使用
网站 - > Asp.Net配置选项。
完整的设置和注释列表可在
中找到machine.config.comments通常位于
\ Windows \ Microsoft.Net\Framework\v2.x\Config
- >
< configuration xmlns =" http://schemas.microsoft.com/.NetConfiguration/v2.0">
< appSettings>
< add key =" ReportServer"值= QUOT; HTTPS:// MYSERVER /的reportserver /" />
< / appSettings>
< system.web>
<! -
设置编译debug =" true"将调试
符号插入编译页面。因为这个
会影响性能,所以在开发过程中将此值设置为true
- >
< compilation debug =" true">
< assemblies>
< add assembly =" System.Design,Version = 2.0.0.0,Culture =中性,
PublicKeyToken = B03F5F7F11D50A3A" />
< add assembly =" System.Windows.Forms,Version = 2.0.0.0,Culture = neutral,
PublicKeyToken = B77A5C561934E089" />
< / assemblies>
< / compilation>
<! -
< authenticationsection启用配置
的
ASP.NET用来识别传入用户的安全认证模式。 />
- >
<身份验证模式=" Windows">
< forms loginUrl =" Index.aspx"
cookieless =" UseUri" />
< / authentication>
< authorization>
< allow users =" *" />
< / authorization>
<! -
< customErrorssection启用配置
如果/当发生未处理的错误时该怎么办?
在执行请求期间。具体来说,
它使开发人员能够配置html错误页面
来代替错误堆栈跟踪。
- >
< customErrors mode =" Off">
< / customErrors>
< trust level =" Full" originUrl = QUOT;" />
< httpModules>
< add name =" Session" type =" System.Web.SessionState.SessionStateModule" />
< / httpModules>
<! - 为所有人启用会话状态Web应用程序中的页面。 - >
< pages>
< controls>
< add tagPrefix =" ajaxToolkit" namespace =" System.Web.UI"
assembly =" System.Web.Extensions,Version = 1.0.61025.0,Culture = neutral,
PublicKeyToken = 31bf3856ad364e35" />
< add namespace =" AjaxControlToolkit" assembly =" AjaxControlToolkit"
tagPrefix =" ajaxToolkit" />
< / controls>
< / pages>
< /system.web>
< / configuration>
I''ve been on this for a while, and cannot figure it out. Can someone please
help with this message?
SessionState 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><httpModulessection in the application
configuration.
Here is my current web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
</system.web>
</configuration>
InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
"Wannabe" wrote:
I''ve been on this for a while, and cannot figure it out. Can someone please
help with this message?
SessionState 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><httpModulessection in the application
configuration.
Here is my current web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
</system.web>
</configuration>
Not sure what you mean, but I do not have an InProc entry in my web.config
file.
"Peter Bromberg [C# MVP]" wrote:
InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
"Wannabe" wrote:
I''ve been on this for a while, and cannot figure it out. Can someone please
help with this message?
SessionState 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><httpModulessection in the application
configuration.
Here is my current web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
</system.web>
</configuration>
re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.
InProc is *also* the default.
If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you''ll need to explicitly set those options.
Check to see if :
<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
....is in your machine.config file...it should be there.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...Not sure what you mean, but I do not have an InProc entry in my web.config
file.
"Peter Bromberg [C# MVP]" wrote:
>InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
"Wannabe" wrote:
I''ve been on this for a while, and cannot figure it out. Can someone please
help with this message?
SessionState 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><httpModulessection in the application
configuration.
Here is my current web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
</system.web>
</configuration>
这篇关于无法使Session State工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!