Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
Ankur\m/ 18-Nov-10 7:37am    
Does the answer by SChristmas solve your problem?
Sandesh M Patil 18-Nov-10 7:56am    
Please elaborate your question. What is the mode your are using for maintaining session state

1 solution

Add this in web.config

ASP
<sessionState mode="SQLServer" stateConnectionString="tcpip=192.168.1.1:42424";
sqlConnectionString="data source=192.168.1.1; Integrated
Security=SSPI"
cookieless="false"
timeout="20";
/>




Also add Global.asax in your application.
 
Share this answer
 
v3
Comments
Dalek Dave 18-Nov-10 7:22am    
Edited for Code Block.
Ankur\m/ 18-Nov-10 7:31am    
Why do you think he is storing the session in SQL Server?
Sandesh M Patil 18-Nov-10 7:37am    
I add a hint here he can add mode="InProc" also if he want. However he mention Sql server 2005. Thats why i considered while giving a solution :)
Ankur\m/ 18-Nov-10 7:54am    
That's because he has no idea about the problem and he tried every possible solution. A database is must for any interactive web development so it's a part of his development tools.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900