我的网站出现会话错误 [英] I am getting session error in my website

查看:56
本文介绍了我的网站出现会话错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b



这是错误





会话状态只能在配置文件或Page指令中将enableSessionState设置为true时使用。另请确保System.Web.SessionStateModule或自定义会话状态模块包含在< configuration> \< system.web> \< httpmodules>中。应用程序配置中的部分。



帮助我

Hi

This is the error


Session state 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>\<httpmodules> section in the application configuration.

Help Me

推荐答案

尝试为您的应用程序启用SessionState。请参考以下链接:

如何在ASP.NET中启用会话状态 [ ^ ]





--Amit
Try Enabling SessionState for your Application. Refer the link below:
How to enable Session state in ASP.NET[^]


--Amit


1. Enable the ASP.NET Session State Manager Service (under Control Panel > Administrative Tools > Services)

2. Enable it in the web.config file: <pages enableSessionState="true">

3. Add the proper http module to the web.config: <add name="Session" type="System.Web.SessionState.SessionStateModule" />

4. At last but not least: Make sure you're accessing the Session object after it has been initialized. This is very important, since if you try to manipulate it in the page constructor, for example (which was my case), you'll still get the above exception, even after executing steps 1, 2 and 3. You should be able to access it after the page OnLoad event has been fired.


这篇关于我的网站出现会话错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆