创建会话对象时出错 [英] Error while creating session object
问题描述
亲爱的所有人,
我有一些有趣的问题. :confused:
我有一个网站,单击按钮即可在其中创建一些会话.
它可以在一台PC上工作,但是当我在另一台PC上运行该网站时,会显示以下错误.
我重新安装了Windows,Visual Studio 2005,SQL Server 2005和IIS.
如果某人有这样的问题并且有解决方案,请告诉我.
Dear All,
I have Some Interesting Problem. :confused:
I Have web site in which some session is created on button click.
it work on one pc but when i run that web site on another pc following error shows.
i reinstall windows, visual studio 2005 and sql server 2005 and IIS.
IF SOME ONE HAVE SUCH KIND OF PROBLEM AND HAVE SOLUTION PLZ TELL ME.
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
推荐答案
将其添加到web.config
Add this in web.config
<sessionState mode="SQLServer" stateConnectionString="tcpip=192.168.1.1:42424";
sqlConnectionString="data source=192.168.1.1; Integrated
Security=SSPI"
cookieless="false"
timeout="20";
/>
还要在您的应用程序中添加Global.asax.
Also add Global.asax in your application.
这篇关于创建会话对象时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!